title: After I change the fs/myext2/file.c read and write operation, my 'cat', 'cp', 'echo' are all killed
body: <p>I copy the fs/ext2/ as fs/myext2/, and have modified all the things I need to modify, and it all does well before I change the fs/myext2/file.c.
  And it does well, when I change like this (</p>
  
  <p>Add following codes into file.c, and the <code>new_sync_write</code> and <code>new_sync_read</code> functions are copied from fs/read_write.c. </p>
  
  <p>And I also add another header <code>linux/uio.h</code>, </p>
  
  <p>add <code>.read  = new_sync_read_crypt, .write = new_sync_write_crypt</code> to <code>const struct file_operations myext2_file_operations</code>).</p>
  
  <pre><code>ssize_t new_sync_write_crypt(struct file *filp, const char __user *buf, size_t len, loff_t *ppos){
      char *mybuf = buf;
      int i;
      /*for(i=0;i&lt;len;i++){
          mybuf[i] += 25;
      }*/
      printk("haha write encrypt %ld\n",len);
      return new_sync_write(filp,mybuf,len,ppos);
  }
  
  ssize_t new_sync_read_crypt(struct file *filp, char __user *buf, size_t len, loff_t *ppos){
  
      ssize_t ret = new_sync_read(filp,buf,len,ppos);
      int i;
      /*for(i = 0; i &lt; len; i++)
          buf[i] -= 25;*/
      printk("haha read encrypt %ld\n",len);
      return ret;
  }
  </code></pre>
  
  <p>'does well' means that, under /mnt, I <code>echo "1234567" &gt; test.txt</code>, and in log(<code>dmesg</code>) it does have the right output, and I can 'cp', 'cat'.</p>
  
  <p>but after I move the <code>/**/</code>, all go wrong.
  I cannot 'cat test.txt', it said <code>killed</code>.</p>
  
  <pre><code>root@ubuntu:/mnt# cat test.txt
  killed
  root@ubuntu:/mnt#
  </code></pre>
  
  <p>in log:</p>
  
  <pre><code>[ 5640.036210] BUG: unable to handle kernel paging request at b733f000
  [ 5640.036215] IP: [&lt;f9072aa0&gt;] new_sync_read_crypt+0xc0/0x100 [myext2]
  [ 5640.036220] *pdpt = 0000000011da5001 *pde = 0000000004708067 *pte =     0000000000000000 
  [ 5640.036222] Oops: 0002 [#21] SMP 
  [ 5640.036225] Modules linked in: myext2(OE) rfcomm bnep crc32_pclmul vmw_balloon aesni_intel aes_i586 xts lrw gf128mul ablk_helper cryptd joydev input_leds serio_raw snd_ens1371 snd_ac97_codec gameport ac97_bus vmw_vsock_vmci_transport vsock snd_pcm snd_seq_midi uvcvideo videobuf2_vmalloc videobuf2_memops snd_seq_midi_event videobuf2_v4l2 snd_rawmidi btusb btrtl btbcm videobuf2_core btintel videodev bluetooth media snd_seq snd_seq_device snd_timer snd soundcore nfit 8250_fintek mac_hid vmw_vmci i2c_piix4 shpchp parport_pc ppdev lp parport autofs4 hid_generic usbhid hid psmouse vmwgfx ttm drm_kms_helper ahci libahci mptspi mptscsih pcnet32 mii syscopyarea sysfillrect sysimgblt fb_sys_fops drm mptbase scsi_transport_spi pata_acpi fjes [last unloaded: myext2]
  [ 5640.036249] CPU: 0 PID: 9011 Comm: cat Tainted: G      D    OE   4.6.0 #1
  [ 5640.036250] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/19/2017
  [ 5640.036252] task: f549dc40 ti: d1da6000 task.ti: d1da6000
  [ 5640.036253] EIP: 0060:[&lt;f9072aa0&gt;] EFLAGS: 00010206 CPU: 0
  [ 5640.036255] EIP is at new_sync_read_crypt+0xc0/0x100 [myext2]
  [ 5640.036256] EAX: b735f000 EBX: b733f000 ECX: d1da7f60 EDX: 00000000
  [ 5640.036258] ESI: 00020000 EDI: 00000000 EBP: d1da7ed8 ESP: d1da7e88
  [ 5640.036259]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
  [ 5640.036260] CR0: 80050033 CR2: b733f000 CR3: 30ef0120 CR4: 003406f0
  [ 5640.036265] Stack:
  [ 5640.036265]  00000001 00020000 d1da7f60 b733f000 00020000 00000000 00000000 00020000
  [ 5640.036268]  d1da7e94 00000001 f2bdac00 00000000 00000000 00000000 00000000 00000000
  [ 5640.036271]  ffa41c7b f2bdac00 f90729e0 d1da7f60 d1da7f2c c11ea28f d1da7f60 c6e50cf8
  [ 5640.036274] Call Trace:
  [ 5640.036277]  [&lt;f90729e0&gt;] ? myext2_empty_dir+0x170/0x170 [myext2]
  [ 5640.036280]  [&lt;c11ea28f&gt;] __vfs_read+0x2f/0x100
  [ 5640.036282]  [&lt;c11ea76e&gt;] ? rw_verify_area+0x5e/0x140
  [ 5640.036284]  [&lt;c11ea8bf&gt;] vfs_read+0x6f/0x140
  [ 5640.036286]  [&lt;c11eb9e1&gt;] SyS_read+0x51/0xb0
  [ 5640.036288]  [&lt;c100394d&gt;] do_fast_syscall_32+0x8d/0x140
  [ 5640.036291]  [&lt;c17baa2e&gt;] sysenter_past_esp+0x47/0x75
  [ 5640.036292] Code: 8d 45 d8 ff 51 10 3d ef fd ff ff 89 c7 74 54 8b 45 dc 8b 4d b8 85 f6 8b 55 e0 89 01 8d 04 33 89 51 04 74 11 8d b4 26 00 00 00 00 &lt;80&gt; 2b 19 83 c3 01 39 d8 75 f6 89 74 24 04 c7 04 24 b5 b9 07 f9
  [ 5640.036311] EIP: [&lt;f9072aa0&gt;] new_sync_read_crypt+0xc0/0x100     [myext2] SS:ESP 0068:d1da7e88
  [ 5640.036320] CR2: 00000000b733f000
  [ 5640.036322] ---[ end trace d357a556f62edff8 ]---
  </code></pre>