Re: [PATCH] overlayfs: improve ovl_get_acl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



on 2022/07/27 21:33, Miklos Szeredi wrote:
> On Fri, 15 Jul 2022 at 12:06, Yang Xu <xuyang2018.jy@xxxxxxxxxxx> wrote:
>>
>> Provide a proper stub for the !CONFIG_FS_POSIX_ACL case.
>>
>> Signed-off-by: Yang Xu <xuyang2018.jy@xxxxxxxxxxx>
>> ---
>>   fs/overlayfs/inode.c     | 2 +-
>>   fs/overlayfs/overlayfs.h | 6 ++++++
>>   2 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
>> index 492eddeb481f..ba2dde24c1f7 100644
>> --- a/fs/overlayfs/inode.c
>> +++ b/fs/overlayfs/inode.c
>> @@ -460,7 +460,7 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
>>          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)
>> diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
>> index 4f34b7e02eee..3d8de16a76e9 100644
>> --- a/fs/overlayfs/overlayfs.h
>> +++ b/fs/overlayfs/overlayfs.h
>> @@ -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
>> +
> 
> Shouldn't ovl_get_acl() definition also be wrapped in #ifdef
> CONFIG_FS_POSIX_ACL?

Of course.

Best Reagrds
Yang Xu
> 
> Thanks,
> Miklos




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux