From ab1a8a0277965395d42db71b6b0f479207c26fdc Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Thu, 8 Aug 2019 22:52:06 -0500 Subject: [PATCH] LU-12634 llite: lm_compare_owner removed Linux 5.3 removed lm_compare_owner kernel-commit: f85d93385e9fe6886a751f647f6812a89bf6bee3 Test-Parameters: trivial Cray-bug-id: LUS-7689 Signed-off-by: Shaun Tancheff Change-Id: I3aa33df0fcd2443ff8ac5dc8b1c893de92931352 Reviewed-on: https://review.whamcloud.com/35747 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 26 +++++++++++++++++++++++++- lustre/llite/file.c | 2 ++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 4115ad8..28e2b80 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -478,7 +478,7 @@ lock_manager_ops_lm_xxx, [ #include ],[ 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 +],[ + 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 diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 9e82a2c..cd7d1f6 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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: -- 1.8.3.1