nfs: fix xfstest generic/099 failed on nfsv3
diff mbox series

Message ID 1550501803-27999-1-git-send-email-zhangxiaoxu5@huawei.com
State New
Headers show
Series
  • nfs: fix xfstest generic/099 failed on nfsv3
Related show

Commit Message

zhangxiaoxu (A) Feb. 18, 2019, 2:56 p.m. UTC
After setxattr, the nfsv3 cached the acl which set by user.

But at the backend, the shared file system (eg. ext4) will check
the acl, if it can merged with mode, it won't add acl to the file.
So, the nfsv3 cached acl is redundant.

Don't 'set_cached_acl' when setxattr.

Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
---
 fs/nfs/nfs3acl.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Trond Myklebust Feb. 21, 2019, 10:36 p.m. UTC | #1
On Mon, 2019-02-18 at 22:56 +0800, ZhangXiaoxu wrote:
> After setxattr, the nfsv3 cached the acl which set by user.
> 
> But at the backend, the shared file system (eg. ext4) will check
> the acl, if it can merged with mode, it won't add acl to the file.
> So, the nfsv3 cached acl is redundant.
> 
> Don't 'set_cached_acl' when setxattr.
> 
> Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
> ---
>  fs/nfs/nfs3acl.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
> index 9fce185..c5c3fc6 100644
> --- a/fs/nfs/nfs3acl.c
> +++ b/fs/nfs/nfs3acl.c
> @@ -222,8 +222,6 @@ static int __nfs3_proc_setacls(struct inode
> *inode, struct posix_acl *acl,
>  	switch (status) {
>  		case 0:
>  			status = nfs_refresh_inode(inode, fattr);
> -			set_cached_acl(inode, ACL_TYPE_ACCESS, acl);
> -			set_cached_acl(inode, ACL_TYPE_DEFAULT, dfacl);
>  			break;
>  		case -EPFNOSUPPORT:
>  		case -EPROTONOSUPPORT:

Looks good. I've applied it to the linux-next branch for the 5.1 merge
window.

Thanks,
  Trond

Patch
diff mbox series

diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
index 9fce185..c5c3fc6 100644
--- a/fs/nfs/nfs3acl.c
+++ b/fs/nfs/nfs3acl.c
@@ -222,8 +222,6 @@  static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
 	switch (status) {
 		case 0:
 			status = nfs_refresh_inode(inode, fattr);
-			set_cached_acl(inode, ACL_TYPE_ACCESS, acl);
-			set_cached_acl(inode, ACL_TYPE_DEFAULT, dfacl);
 			break;
 		case -EPFNOSUPPORT:
 		case -EPROTONOSUPPORT: