Whamcloud - gitweb
LU-12634 llite: lm_compare_owner removed 47/35747/2
authorShaun Tancheff <stancheff@cray.com>
Fri, 9 Aug 2019 03:52:06 +0000 (22:52 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Sep 2019 23:04:30 +0000 (23:04 +0000)
Linux 5.3 removed lm_compare_owner

kernel-commit: f85d93385e9fe6886a751f647f6812a89bf6bee3

Test-Parameters: trivial
Cray-bug-id: LUS-7689
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: I3aa33df0fcd2443ff8ac5dc8b1c893de92931352
Reviewed-on: https://review.whamcloud.com/35747
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/llite/file.c

index 4115ad8..28e2b80 100644 (file)
@@ -478,7 +478,7 @@ lock_manager_ops_lm_xxx, [
        #include <linux/fs.h>
 ],[
        struct lock_manager_operations lm_ops;
-       lm_ops.lm_compare_owner = NULL;
+       lm_ops.lm_notify = NULL;
 ],[
        AC_DEFINE(HAVE_LM_XXX_LOCK_MANAGER_OPS, 1,
                [lock-manager ops renamed to lm_xxx])
@@ -2853,6 +2853,29 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_BIO_BI_PHYS_SEGMENTS
 
 #
+# LC_LM_COMPARE_OWNER_EXISTS
+#
+# kernel 5.3-rc3 commit f85d93385e9fe6886a751f647f6812a89bf6bee3
+# locks: Cleanup lm_compare_owner and lm_owner_key
+# removed lm_compare_owner
+#
+AC_DEFUN([LC_LM_COMPARE_OWNER_EXISTS], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if lock_manager_operations has lm_compare_owner],
+lock_manager_ops_lm_compare_owner, [
+       #include <linux/fs.h>
+],[
+       struct lock_manager_operations lm_ops;
+       lm_ops.lm_compare_owner = NULL;
+],[
+       AC_DEFINE(HAVE_LM_COMPARE_OWNER, 1,
+               [lock_manager_operations has lm_compare_owner])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_LM_COMPARE_OWNER_EXISTS
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -3082,6 +3105,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 5.3
        LC_BIO_BI_PHYS_SEGMENTS
+       LC_LM_COMPARE_OWNER_EXISTS
 
        # kernel patch to extend integrity interface
        LC_BIO_INTEGRITY_PREP_FN
index 9e82a2c..cd7d1f6 100644 (file)
@@ -4229,6 +4229,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
         }
         flock.l_flock.pid = file_lock->fl_pid;
 
+#if defined(HAVE_LM_COMPARE_OWNER) || defined(lm_compare_owner)
        /* Somewhat ugly workaround for svc lockd.
         * lockd installs custom fl_lmops->lm_compare_owner that checks
         * for the fl_owner to be the same (which it always is on local node
@@ -4238,6 +4239,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
         * pointer space for current->files are not intersecting */
        if (file_lock->fl_lmops && file_lock->fl_lmops->lm_compare_owner)
                flock.l_flock.owner = (unsigned long)file_lock->fl_pid;
+#endif
 
        switch (fl_type) {
         case F_RDLCK: