Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=kernelbump.git;a=commitdiff;h=013779d8c5e455179bdf90543acbfed0b7c88105

commit 013779d8c5e455179bdf90543acbfed0b7c88105
Author: DeX77 <[email protected]>
Date:   Mon Jul 3 12:00:26 2017 +0200

spl-0.7.0-30-x86_64

* rebuild with kernel 4.12

diff --git a/source/base-extra/spl/FrugalBuild 
b/source/base-extra/spl/FrugalBuild
index 8ff5544..5015525 100644
--- a/source/base-extra/spl/FrugalBuild
+++ b/source/base-extra/spl/FrugalBuild
@@ -3,8 +3,8 @@

pkgname=spl
pkgver=0.7.0
-pkgextraver="-rc3"
-pkgrel=29
+pkgextraver="-rc4"
+pkgrel=30
pkgdesc="ZFS Solaris Porting Layer"
url="http://zfsonlinux.org";
depends=('glibc')
@@ -12,9 +12,9 @@ groups=('base-extra')
archs=('x86_64')
up2date="Flasttar $url"
source=(https://github.com/zfsonlinux/$pkgname/archive/$pkgname-$pkgver$pkgextraver.tar.gz
 \
-       kernel-4.11.patch )
-sha1sums=('bd1909cae5711713926e40d1c3ec7256e789be8b' \
-          'bf1fde48dd509e296f6269e09d6c91d7d7f15ff8')
+       kernel-4.12.patch )
+sha1sums=('f3ea3ba763f114dba46ba3b07931b0b85197b880' \
+          '2469620a8b87745cbdfc2eb20e5bf84434308439')
_F_cd_path="$pkgname-$pkgname-$pkgver$pkgextraver"
Finclude kernel-module

diff --git a/source/base-extra/spl/kernel-4.11.patch 
b/source/base-extra/spl/kernel-4.11.patch
deleted file mode 100644
index c33dd9f..0000000
--- a/source/base-extra/spl/kernel-4.11.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -Naur spl-spl-0.7.0-rc3/config/spl-build.m4 
spl-spl-0.7.0-rc3.new/config/spl-build.m4
---- spl-spl-0.7.0-rc3/config/spl-build.m4      2017-01-20 19:17:40.000000000 
+0100
-+++ spl-spl-0.7.0-rc3.new/config/spl-build.m4  2017-05-01 15:25:07.000000000 
+0200
-@@ -33,7 +33,6 @@
-       SPL_AC_INODE_TRUNCATE_RANGE
-       SPL_AC_FS_STRUCT_SPINLOCK
-       SPL_AC_KUIDGID_T
--      SPL_AC_PUT_TASK_STRUCT
-       SPL_AC_KERNEL_FALLOCATE
-       SPL_AC_CONFIG_ZLIB_INFLATE
-       SPL_AC_CONFIG_ZLIB_DEFLATE
-@@ -43,6 +42,9 @@
-       SPL_AC_RWSEM_ACTIVITY
-       SPL_AC_RWSEM_ATOMIC_LONG_COUNT
-       SPL_AC_SCHED_RT_HEADER
-+      SPL_AC_SCHED_SIGNAL_HEADER
-+      SPL_AC_4ARGS_VFS_GETATTR
-+      SPL_AC_3ARGS_VFS_GETATTR
-       SPL_AC_2ARGS_VFS_GETATTR
-       SPL_AC_USLEEP_RANGE
-       SPL_AC_KMEM_CACHE_ALLOCFLAGS
-@@ -1083,25 +1085,6 @@
- ])
-
- dnl #
--dnl # 2.6.39 API change,
--dnl # __put_task_struct() was exported by the mainline kernel.
--dnl #
--AC_DEFUN([SPL_AC_PUT_TASK_STRUCT],
--      [AC_MSG_CHECKING([whether __put_task_struct() is available])
--      SPL_LINUX_TRY_COMPILE_SYMBOL([
--              #include <linux/sched.h>
--      ], [
--              __put_task_struct(NULL);
--      ], [__put_task_struct], [], [
--              AC_MSG_RESULT(yes)
--              AC_DEFINE(HAVE_PUT_TASK_STRUCT, 1,
--                        [__put_task_struct() is available])
--      ], [
--              AC_MSG_RESULT(no)
--      ])
--])
--
--dnl #
- dnl # 2.6.35 API change,
- dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype.
- dnl #
-@@ -1410,33 +1393,84 @@
- ])
-
- dnl #
--dnl # 3.9 API change,
--dnl # vfs_getattr() uses 2 args
--dnl # It takes struct path * instead of struct vfsmount * and struct dentry *
-+dnl # 4.11 API change,
-+dnl # Moved things from linux/sched.h to linux/sched/signal.h
-+dnl #
-+AC_DEFUN([SPL_AC_SCHED_SIGNAL_HEADER],
-+      [AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
-+      SPL_LINUX_TRY_COMPILE([
-+              #include <linux/sched.h>
-+              #include <linux/sched/signal.h>
-+      ],[
-+              return 0;
-+      ],[
-+              AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1, [linux/sched/signal.h 
exists])
-+              AC_MSG_RESULT(yes)
-+      ],[
-+              AC_MSG_RESULT(no)
-+      ])
-+])
-+
-+dnl #
-+dnl # 4.11 API, a528d35e@torvalds/linux
-+dnl # vfs_getattr(const struct path *p, struct kstat *s, u32 m, unsigned int 
f)
-+dnl #
-+AC_DEFUN([SPL_AC_4ARGS_VFS_GETATTR], [
-+      AC_MSG_CHECKING([whether vfs_getattr() wants 4 args])
-+      SPL_LINUX_TRY_COMPILE([
-+              #include <linux/fs.h>
-+      ],[
-+              vfs_getattr((const struct path *)NULL,
-+                      (struct kstat *)NULL,
-+                      (u32)0,
-+                      (unsigned int)0);
-+      ],[
-+              AC_MSG_RESULT(yes)
-+              AC_DEFINE(HAVE_4ARGS_VFS_GETATTR, 1,
-+                [vfs_getattr wants 4 args])
-+      ],[
-+              AC_MSG_RESULT(no)
-+      ])
-+])
-+
-+dnl #
-+dnl # 3.9 API
-+dnl # vfs_getattr(struct path *p, struct kstat *s)
- dnl #
- AC_DEFUN([SPL_AC_2ARGS_VFS_GETATTR], [
--      AC_MSG_CHECKING([whether vfs_getattr() wants])
-+      AC_MSG_CHECKING([whether vfs_getattr() wants 2 args])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               vfs_getattr((struct path *) NULL,
-                       (struct kstat *)NULL);
-       ],[
--              AC_MSG_RESULT(2 args)
-+              AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
--                        [vfs_getattr wants 2 args])
-+                        [vfs_getattr wants 2 args])
-       ],[
--              SPL_LINUX_TRY_COMPILE([
--                      #include <linux/fs.h>
--              ],[
--                      vfs_getattr((struct vfsmount *)NULL,
--                              (struct dentry *)NULL,
--                              (struct kstat *)NULL);
--              ],[
--                      AC_MSG_RESULT(3 args)
--              ],[
--                      AC_MSG_ERROR(unknown)
--              ])
-+              AC_MSG_RESULT(no)
-+      ])
-+])
-+
-+dnl #
-+dnl # <3.9 API
-+dnl # vfs_getattr(struct vfsmount *v, struct dentry *d, struct kstat *k)
-+dnl #
-+AC_DEFUN([SPL_AC_3ARGS_VFS_GETATTR], [
-+      AC_MSG_CHECKING([whether vfs_getattr() wants 3 args])
-+      SPL_LINUX_TRY_COMPILE([
-+              #include <linux/fs.h>
-+      ],[
-+              vfs_getattr((struct vfsmount *)NULL,
-+                      (struct dentry *)NULL,
-+                      (struct kstat *)NULL);
-+      ],[
-+              AC_MSG_RESULT(yes)
-+              AC_DEFINE(HAVE_3ARGS_VFS_GETATTR, 1,
-+                [vfs_getattr wants 3 args])
-+      ],[
-+              AC_MSG_RESULT(no)
-       ])
- ])
-
-diff -Naur spl-spl-0.7.0-rc3/include/sys/signal.h 
spl-spl-0.7.0-rc3.new/include/sys/signal.h
---- spl-spl-0.7.0-rc3/include/sys/signal.h     2017-01-20 19:17:40.000000000 
+0100
-+++ spl-spl-0.7.0-rc3.new/include/sys/signal.h 2017-05-01 15:25:02.000000000 
+0200
-@@ -27,6 +27,10 @@
-
- #include <linux/sched.h>
-
-+#ifdef HAVE_SCHED_SIGNAL_HEADER
-+#include <linux/sched/signal.h>
-+#endif
-+
- #define       FORREAL         0       /* Usual side-effects */
- #define       JUSTLOOKING     1       /* Don't stop the process */
-
-diff -Naur spl-spl-0.7.0-rc3/module/spl/spl-err.c 
spl-spl-0.7.0-rc3.new/module/spl/spl-err.c
---- spl-spl-0.7.0-rc3/module/spl/spl-err.c     2017-01-20 19:17:40.000000000 
+0100
-+++ spl-spl-0.7.0-rc3.new/module/spl/spl-err.c 2017-05-01 15:24:44.000000000 
+0200
-@@ -65,7 +65,7 @@
-       spl_dumpstack();
-
-       /* Halt the thread to facilitate further debugging */
--      set_task_state(current, TASK_UNINTERRUPTIBLE);
-+      set_current_state(TASK_UNINTERRUPTIBLE);
-       while (1)
-               schedule();
-
-@@ -98,7 +98,7 @@
-               spl_dumpstack();
-
-               /* Halt the thread to facilitate further debugging */
--              set_task_state(current, TASK_UNINTERRUPTIBLE);
-+              set_current_state(TASK_UNINTERRUPTIBLE);
-               while (1)
-                       schedule();
-       }
-diff -Naur spl-spl-0.7.0-rc3/module/spl/spl-generic.c 
spl-spl-0.7.0-rc3.new/module/spl/spl-generic.c
---- spl-spl-0.7.0-rc3/module/spl/spl-generic.c 2017-01-20 19:17:40.000000000 
+0100
-+++ spl-spl-0.7.0-rc3.new/module/spl/spl-generic.c     2017-05-01 
15:25:07.000000000 +0200
-@@ -459,22 +459,6 @@
- }
- EXPORT_SYMBOL(ddi_copyout);
-
--#ifndef HAVE_PUT_TASK_STRUCT
--/*
-- * This is only a stub function which should never be used.  The SPL should
-- * never be putting away the last reference on a task structure so this will
-- * not be called.  However, we still need to define it so the module does not
-- * have undefined symbol at load time.  That all said if this impossible
-- * thing does somehow happen PANIC immediately so we know about it.
-- */
--void
--__put_task_struct(struct task_struct *t)
--{
--      PANIC("Unexpectly put last reference on task %d\n", (int)t->pid);
--}
--EXPORT_SYMBOL(__put_task_struct);
--#endif /* HAVE_PUT_TASK_STRUCT */
--
- /*
-  * Read the unique system identifier from the /etc/hostid file.
-  *
-diff -Naur spl-spl-0.7.0-rc3/module/spl/spl-vnode.c 
spl-spl-0.7.0-rc3.new/module/spl/spl-vnode.c
---- spl-spl-0.7.0-rc3/module/spl/spl-vnode.c   2017-01-20 19:17:40.000000000 
+0100
-+++ spl-spl-0.7.0-rc3.new/module/spl/spl-vnode.c       2017-05-01 
15:24:55.000000000 +0200
-@@ -153,7 +153,9 @@
-       if (IS_ERR(fp))
-               return (-PTR_ERR(fp));
-
--#ifdef HAVE_2ARGS_VFS_GETATTR
-+#if defined(HAVE_4ARGS_VFS_GETATTR)
-+      rc = vfs_getattr(&fp->f_path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
-+#elif defined(HAVE_2ARGS_VFS_GETATTR)
-       rc = vfs_getattr(&fp->f_path, &stat);
- #else
-       rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat);
-@@ -510,7 +512,10 @@
-
-       fp = vp->v_file;
-
--#ifdef HAVE_2ARGS_VFS_GETATTR
-+#if defined(HAVE_4ARGS_VFS_GETATTR)
-+      rc = vfs_getattr(&fp->f_path, &stat, STATX_BASIC_STATS,
-+          AT_STATX_SYNC_AS_STAT);
-+#elif defined(HAVE_2ARGS_VFS_GETATTR)
-       rc = vfs_getattr(&fp->f_path, &stat);
- #else
-       rc = vfs_getattr(fp->f_path.mnt, fp->f_dentry, &stat);
-@@ -708,7 +713,9 @@
-       if (vp == NULL)
-               goto out_fget;
-
--#ifdef HAVE_2ARGS_VFS_GETATTR
-+#if defined(HAVE_4ARGS_VFS_GETATTR)
-+      rc = vfs_getattr(&lfp->f_path, &stat, STATX_TYPE, 
AT_STATX_SYNC_AS_STAT);
-+#elif defined(HAVE_2ARGS_VFS_GETATTR)
-       rc = vfs_getattr(&lfp->f_path, &stat);
- #else
-       rc = vfs_getattr(lfp->f_path.mnt, lfp->f_dentry, &stat);
diff --git a/source/base-extra/spl/kernel-4.12.patch 
b/source/base-extra/spl/kernel-4.12.patch
new file mode 100644
index 0000000..d90ba2b
--- /dev/null
+++ b/source/base-extra/spl/kernel-4.12.patch
@@ -0,0 +1,136 @@
+From 8f87971e1fd11e3bca034dff2cbc0e884381c350 Mon Sep 17 00:00:00 2001
+From: Chunwei Chen <[email protected]>
+Date: Tue, 9 May 2017 10:36:54 -0700
+Subject: [PATCH] Linux 4.12 compat: PF_FSTRANS was removed
+
+Change SPL_FSTRANS to optionally contains PF_FSTRANS. Also, add
+__spl_pf_fstrans_check for the checks specifically for PF_FSTRANS.
+
+Reviewed-by: Brian Behlendorf <[email protected]>
+Signed-off-by: Chunwei Chen <[email protected]>
+Closes #614
+---
+ include/sys/kmem.h     | 37 +++++++++++++++++++++++++++++++++----
+ module/spl/spl-vnode.c | 12 ++++++------
+ 2 files changed, 39 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/kmem.h b/include/sys/kmem.h
+index d4b3bf68..d6b42855 100644
+--- a/include/sys/kmem.h
++++ b/include/sys/kmem.h
+@@ -46,6 +46,8 @@ extern void strfree(char *str);
+
+ #define       KM_PUBLIC_MASK  (KM_SLEEP | KM_NOSLEEP | KM_PUSHPAGE)
+
++static int spl_fstrans_check(void);
++
+ /*
+  * Convert a KM_* flags mask to its Linux GFP_* counterpart.  The conversion
+  * function is context aware which means that KM_SLEEP allocations can be
+@@ -60,7 +62,7 @@ kmem_flags_convert(int flags)
+               lflags |= GFP_ATOMIC | __GFP_NORETRY;
+       } else {
+               lflags |= GFP_KERNEL;
+-              if ((current->flags & PF_FSTRANS))
++              if (spl_fstrans_check())
+                       lflags &= ~(__GFP_IO|__GFP_FS);
+       }
+
+@@ -78,17 +80,34 @@ typedef struct {
+       unsigned int saved_flags;
+ } fstrans_cookie_t;
+
++/*
++ * Introduced in Linux 3.9, however this cannot be solely relied on before
++ * Linux 3.18 as it doesn't turn off __GFP_FS as it should.
++ */
+ #ifdef PF_MEMALLOC_NOIO
+-#define       SPL_FSTRANS (PF_FSTRANS|PF_MEMALLOC_NOIO)
++#define       __SPL_PF_MEMALLOC_NOIO (PF_MEMALLOC_NOIO)
++#else
++#define       __SPL_PF_MEMALLOC_NOIO (0)
++#endif
++
++/*
++ * PF_FSTRANS is removed from Linux 4.12
++ */
++#ifdef PF_FSTRANS
++#define       __SPL_PF_FSTRANS (PF_FSTRANS)
+ #else
+-#define       SPL_FSTRANS (PF_FSTRANS)
++#define       __SPL_PF_FSTRANS (0)
+ #endif
+
++#define       SPL_FSTRANS (__SPL_PF_FSTRANS|__SPL_PF_MEMALLOC_NOIO)
++
+ static inline fstrans_cookie_t
+ spl_fstrans_mark(void)
+ {
+       fstrans_cookie_t cookie;
+
++      BUILD_BUG_ON(SPL_FSTRANS == 0);
++
+       cookie.fstrans_thread = current;
+       cookie.saved_flags = current->flags & SPL_FSTRANS;
+       current->flags |= SPL_FSTRANS;
+@@ -109,7 +128,17 @@ spl_fstrans_unmark(fstrans_cookie_t cookie)
+ static inline int
+ spl_fstrans_check(void)
+ {
+-      return (current->flags & PF_FSTRANS);
++      return (current->flags & SPL_FSTRANS);
++}
++
++/*
++ * specifically used to check PF_FSTRANS flag, cannot be relied on for
++ * checking spl_fstrans_mark().
++ */
++static inline int
++__spl_pf_fstrans_check(void)
++{
++      return (current->flags & __SPL_PF_FSTRANS);
+ }
+
+ #ifdef HAVE_ATOMIC64_T
+diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
+index 0902e116..346e63c0 100644
+--- a/module/spl/spl-vnode.c
++++ b/module/spl/spl-vnode.c
+@@ -558,13 +558,13 @@ int vn_fsync(vnode_t *vp, int flags, void *x3, void *x4)
+        * May enter XFS which generates a warning when PF_FSTRANS is set.
+        * To avoid this the flag is cleared over vfs_sync() and then reset.
+        */
+-      fstrans = spl_fstrans_check();
++      fstrans = __spl_pf_fstrans_check();
+       if (fstrans)
+-              current->flags &= ~(PF_FSTRANS);
++              current->flags &= ~(__SPL_PF_FSTRANS);
+
+       error = -spl_filp_fsync(vp->v_file, datasync);
+       if (fstrans)
+-              current->flags |= PF_FSTRANS;
++              current->flags |= __SPL_PF_FSTRANS;
+
+       return (error);
+ } /* vn_fsync() */
+@@ -590,9 +590,9 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int 
flag,
+        * May enter XFS which generates a warning when PF_FSTRANS is set.
+        * To avoid this the flag is cleared over vfs_sync() and then reset.
+        */
+-      fstrans = spl_fstrans_check();
++      fstrans = __spl_pf_fstrans_check();
+       if (fstrans)
+-              current->flags &= ~(PF_FSTRANS);
++              current->flags &= ~(__SPL_PF_FSTRANS);
+
+       /*
+        * When supported by the underlying file system preferentially
+@@ -603,7 +603,7 @@ int vn_space(vnode_t *vp, int cmd, struct flock *bfp, int 
flag,
+           bfp->l_start, bfp->l_len);
+
+       if (fstrans)
+-              current->flags |= PF_FSTRANS;
++              current->flags |= __SPL_PF_FSTRANS;
+
+       if (error == 0)
+               return (0);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to