Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
Created June 6, 2019 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreamcat4/d69c879f0f340f2cd46c453abad2af5b to your computer and use it in GitHub Desktop.
Save dreamcat4/d69c879f0f340f2cd46c453abad2af5b to your computer and use it in GitHub Desktop.
Fix zfs spl for building against kernel 5.1 on 0.7.x - reference: https://github.com/zfsonlinux/zfs/issues/8697
diff -Naur a/include/linux/file_compat.h b/include/linux/file_compat.h
--- a/include/linux/file_compat.h 2018-05-08 21:37:01.000000000 +0100
+++ b/include/linux/file_compat.h 2019-06-06 22:40:44.873699894 +0100
@@ -81,7 +81,7 @@
ssize_t ret;
saved_fs = get_fs();
- set_fs(get_ds());
+ set_fs(KERNEL_DS);
ret = vfs_write(file, (__force const char __user *)buf, count, pos);
@@ -101,7 +101,7 @@
ssize_t ret;
saved_fs = get_fs();
- set_fs(get_ds());
+ set_fs(KERNEL_DS);
ret = vfs_read(file, (void __user *)buf, count, pos);
diff -Naur a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
--- a/module/spl/spl-vnode.c 2019-06-06 22:38:40.830428570 +0100
+++ b/module/spl/spl-vnode.c 2019-06-06 22:40:31.706671093 +0100
@@ -608,7 +608,7 @@
* size to ensure strncpy_from_user() does not fail with -EFAULT.
*/
saved_fs = get_fs();
- set_fs(get_ds());
+ set_fs(KERNEL_DS);
rc = user_path_dir(filename, &path);
if (rc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment