Whamcloud - gitweb
LU-14651 build: fix build for el7.9 kernels 03/53503/2
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Mon, 18 Dec 2023 18:19:26 +0000 (11:19 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 01:58:01 +0000 (01:58 +0000)
Handle extra setattr_prepare() argument added in Linux 5.12 kernels
when building on older kernels.

HPE-bug-id: LUS-12059
Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Change-Id: Ie7fd1c4d51b7a9b086cfca0db941321cbcce7057
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53503
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: James Simmons <jsimmons@infradead.org>
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c

index 26e1c44..e52d49f 100644 (file)
@@ -311,11 +311,16 @@ struct ll_inode_info {
 #define inode_permission(ns, inode, mask)      inode_permission(inode, mask)
 #define generic_permission(ns, inode, mask)    generic_permission(inode, mask)
 #define simple_setattr(ns, de, iattr)          simple_setattr(de, iattr)
+#define ll_setattr(ns, de, attr)               ll_setattr(de, attr)
+#ifdef HAVE_STRUCT_POSIX_ACL_XATTR
+#define setattr_prepare(ns, de, at)            setattr_prepare(de, at)
+#else
+#define setattr_prepare(ns, de, at)            inode_change_ok(de->d_inode, at)
+#endif
 #define ll_inode_permission(ns, inode, mask)   ll_inode_permission(inode, mask)
 #ifdef HAVE_INODEOPS_ENHANCED_GETATTR
 #define ll_getattr(ns, path, stat, mask, fl)   ll_getattr(path, stat, mask, fl)
 #endif /* HAVE_INODEOPS_ENHANCED_GETATTR */
-#define ll_setattr(ns, de, attr)               ll_setattr(de, attr)
 #endif
 
 #ifdef IOCB_APPEND
index 34f083a..199b5b0 100644 (file)
@@ -2498,6 +2498,10 @@ int ll_setattr(struct mnt_idmap *map, struct dentry *de, struct iattr *attr)
        enum op_xvalid xvalid = 0;
        int rc;
 
+       rc = setattr_prepare(map, de, attr);
+       if (rc)
+               return rc;
+
        rc = llcrypt_prepare_setattr(de, attr);
        if (rc)
                return rc;