]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ovl: improve ovl_get_acl() if POSIX ACL support is off
authorYang Xu <xuyang2018.jy@fujitsu.com>
Thu, 28 Jul 2022 02:49:24 +0000 (10:49 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 28 Jul 2022 11:24:51 +0000 (13:24 +0200)
Provide a proper stub for the !CONFIG_FS_POSIX_ACL case.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h

index 492eddeb481f3b8aa8b6e1b2feefb287ccfda481..beef5e2ff56399986c0024cadb3f62eab2d339f7 100644 (file)
@@ -454,13 +454,14 @@ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)
        return res;
 }
 
+#ifdef CONFIG_FS_POSIX_ACL
 struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
 {
        struct inode *realinode = ovl_inode_real(inode);
        const struct cred *old_cred;
        struct posix_acl *acl;
 
-       if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
+       if (!IS_POSIXACL(realinode))
                return NULL;
 
        if (rcu)
@@ -472,6 +473,7 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
 
        return acl;
 }
+#endif
 
 int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
 {
index 4f34b7e02eeeb5659345c7929afa147646a4f594..3d8de16a76e925cd83f0432d407186f541ade231 100644 (file)
@@ -599,7 +599,13 @@ int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,
 int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char *name,
                  void *value, size_t size);
 ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
+
+#ifdef CONFIG_FS_POSIX_ACL
 struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu);
+#else
+#define ovl_get_acl    NULL
+#endif
+
 int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags);
 bool ovl_is_private_xattr(struct super_block *sb, const char *name);