openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
281 stars 180 forks source link

Linux 4.14 compat: vfs_read & vfs_write #667

Closed behlendorf closed 6 years ago

behlendorf commented 6 years ago

Slightly modified version of #666 for 4.14 kernels.

pritambaral commented 6 years ago

This looks much better than #666. :)

behlendorf commented 6 years ago

@pritambaral unfortunately it was also broken, which is why all the send/recv tests failed. I've refreshed the patch to drop the old versions of kernel_read/kernel_write. We can't use them because we depend on the value referenced by the pos pointer being updated in order to update the file position. Since the old versions pass the value directly they cannot be used. That's alright, allowing only two interfaces here still covers all cases and is simpler and safer.

pritambaral commented 6 years ago

I think this is fine. I supported the old kernel_read/kernel_write APIs only for the sake of any future backports to those APIs; chances of which are pretty low anyway. And if those old APIs do receive any backported fixes, corresponding changes can be made in spl too.

akatrevorjay commented 6 years ago

This did not detect properly on my system, fyi (4.14.x), I didn't even look into why to be honest, I just hard coded the options in zfs_config.in

behlendorf commented 6 years ago

@akatrevorjay can you provide the exact kernel version and distribution where this didn't work.

akatrevorjay commented 6 years ago

Sure, 4.14.3-041303-generic from Ubuntu's mainline builds

On Fri, Dec 8, 2017, 9:10 AM Brian Behlendorf notifications@github.com wrote:

@akatrevorjay https://github.com/akatrevorjay can ou provide the exact kernel version and distribution where this didn't work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zfsonlinux/spl/pull/667#issuecomment-350317455, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQGIjsEk48wPTRl3VHhzVfF8cFcCdH4ks5s-W1xgaJpZM4QeF_y .

-- Ty, Trevor

tonyhutter commented 6 years ago

@akatrevorjay zfs master builds fine for me on ubuntu 17.10 with the 4.14.5 kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.5/.

...
  LD [M]  /home/hutter/master/zfs/module/zfs/zfs.o
  Building modules, stage 2.
  MODPOST 6 modules
  CC      /home/hutter/master/zfs/module/avl/zavl.mod.o
  CC      /home/hutter/master/zfs/module/icp/icp.mod.o
  CC      /home/hutter/master/zfs/module/nvpair/znvpair.mod.o
  CC      /home/hutter/master/zfs/module/unicode/zunicode.mod.o
  CC      /home/hutter/master/zfs/module/zcommon/zcommon.mod.o
  CC      /home/hutter/master/zfs/module/zfs/zfs.mod.o
  LD [M]  /home/hutter/master/zfs/module/nvpair/znvpair.ko
  LD [M]  /home/hutter/master/zfs/module/zcommon/zcommon.ko
  LD [M]  /home/hutter/master/zfs/module/avl/zavl.ko
  LD [M]  /home/hutter/master/zfs/module/unicode/zunicode.ko
  LD [M]  /home/hutter/master/zfs/module/icp/icp.ko
  LD [M]  /home/hutter/master/zfs/module/zfs/zfs.ko
make[3]: Leaving directory '/usr/src/linux-headers-4.14.5-041405-generic'
make[2]: Leaving directory '/home/hutter/master/zfs/module'
make[2]: Entering directory '/home/hutter/master/zfs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/hutter/master/zfs'
make[1]: Leaving directory '/home/hutter/master/zfs'
hutter@ubuntu17:~/master/zfs$ uname -a
Linux ubuntu17 4.14.5-041405-generic #201712101332 SMP Sun Dec 10 13:33:10 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Are you using the latest zfs and spl? Can you list your build commands and build errors?