Whamcloud - gitweb
LU-16350 osd-ldiskfs: no_llseek removed, dquot_transfer 32/54732/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 11 Apr 2024 07:52:06 +0000 (00:52 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 29 May 2024 05:00:15 +0000 (05:00 +0000)
Linux commit v5.19-rc2-6-g868941b14441
  fs: remove no_llseek

With the removal of no_llseek, leaving .llseek set to NULL
is functionally equivalent. Only provide no_llseek if it exists.

Linux commit v5.19-rc3-6-g71e7b535b890
 quota: port quota helpers mount ids

dquot_transfer adds a user namespace argument. Provide an
osd_dquot_transfer() wrapper to discard the additional
argument for older kernels.

Lustre-change: https://review.whamcloud.com/49266
Lustre-commit: 2de1dbd440e2b26ea1bdf663b92a3e8c62a95ee7

Test-Parameters: trivial
HPE-bug-id: LUS-11376
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: If3165aed0d7b827b90e26d9f0174137d087ce57a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54732
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/ofd/ofd_access_log.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h

index dd1df49..9d66912 100644 (file)
@@ -3239,6 +3239,55 @@ AC_DEFUN([LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO], [
 ]) # LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
 
 #
+# LC_HAVE_NO_LLSEEK
+#
+# Linux commit v5.19-rc2-6-g868941b14441
+#   fs: remove no_llseek
+#
+AC_DEFUN([LC_SRC_HAVE_NO_LLSEEK], [
+       LB2_LINUX_TEST_SRC([no_llseek], [
+               #include <linux/fs.h>
+       ],[
+               static const struct file_operations fops = {
+                       .llseek = &no_llseek,
+               };
+               (void)fops;
+       ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_NO_LLSEEK], [
+       AC_MSG_CHECKING([if no_llseek() is available])
+       LB2_LINUX_TEST_RESULT([no_llseek], [
+               AC_DEFINE(HAVE_NO_LLSEEK, 1, [no_llseek() is available])
+       ])
+]) # LC_HAVE_NO_LLSEEK
+
+#
+# LC_DQUOT_TRANSFER_WITH_USER_NS
+#
+# Linux commit v5.19-rc3-6-g71e7b535b890
+#  quota: port quota helpers mount ids
+#
+AC_DEFUN([LC_SRC_DQUOT_TRANSFER_WITH_USER_NS], [
+       LB2_LINUX_TEST_SRC([dquot_transfer], [
+               #include <linux/quotaops.h>
+       ],[
+               struct user_namespace *userns = NULL;
+               struct inode *inode = NULL;
+               struct iattr *iattr = NULL;
+               int err __attribute__ ((unused));
+
+               err = dquot_transfer(userns, inode, iattr);
+       ],[-Werror])
+])
+AC_DEFUN([LC_DQUOT_TRANSFER_WITH_USER_NS], [
+       AC_MSG_CHECKING([if dquot_transfer() has user_ns argument])
+       LB2_LINUX_TEST_RESULT([dquot_transfer], [
+               AC_DEFINE(HAVE_DQUOT_TRANSFER_WITH_USER_NS, 1,
+                       [dquot_transfer() has user_ns argument])
+       ])
+]) # LC_DQUOT_TRANSFER_WITH_USER_NS
+
+#
 # LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
 #
 # Linux commit v5.19-rc3-392-g5490da4f06d1
@@ -3761,6 +3810,8 @@ AC_DEFUN([LC_PROG_LINUX_SRC], [
        LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
 
        # 6.0
+       LC_SRC_HAVE_NO_LLSEEK
+       LC_SRC_DQUOT_TRANSFER_WITH_USER_NS
        LC_SRC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
        LC_SRC_REGISTER_SHRINKER_FORMAT_NAMED
        LC_SRC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
@@ -4005,6 +4056,8 @@ AC_DEFUN([LC_PROG_LINUX_RESULTS], [
        LC_HAVE_ADDRESS_SPACE_OPERATIONS_RELEASE_FOLIO
 
        # 6.0
+       LC_HAVE_NO_LLSEEK
+       LC_DQUOT_TRANSFER_WITH_USER_NS
        LC_HAVE_ADDRESS_SPACE_OPERATIONS_MIGRATE_FOLIO
        LC_REGISTER_SHRINKER_FORMAT_NAMED
        LC_HAVE_VFS_SETXATTR_NON_CONST_VALUE
index ac7a8e1..51f6af3 100644 (file)
@@ -433,7 +433,9 @@ static const struct file_operations oal_fops = {
        .read = &oal_file_read,
        .write = &oal_file_write,
        .poll = &oal_file_poll,
+#ifdef HAVE_NO_LLSEEK
        .llseek = &no_llseek,
+#endif
 };
 
 static void oal_device_release(struct device *dev)
index 97a9a53..7317a7e 100644 (file)
@@ -3127,7 +3127,7 @@ static int osd_quota_transfer(struct inode *inode, const struct lu_attr *attr,
                iattr.ia_gid = make_kgid(&init_user_ns, attr->la_gid);
 
                lock_dquot_transfer(inode);
-               rc = dquot_transfer(inode, &iattr);
+               rc = osd_dquot_transfer(&init_user_ns, inode, &iattr);
                unlock_dquot_transfer(inode);
                if (rc) {
                        CERROR("%s: quota transfer failed. Is quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
index f7b164e..72559bb 100644 (file)
@@ -1749,4 +1749,10 @@ static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
        return false;
 }
 
+#ifdef HAVE_DQUOT_TRANSFER_WITH_USER_NS
+#define osd_dquot_transfer(ns, i, a)   dquot_transfer((ns), (i), (a))
+#else
+#define osd_dquot_transfer(ns, i, a)   dquot_transfer((i), (a))
+#endif
+
 #endif /* _OSD_INTERNAL_H */