aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchendt <chendt.fnst@cn.fujitsu.com>2018-03-29 04:13:09 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-04-10 16:06:22 -0400
commitdbc898ae107104ef49fd977a593e521fcefab5aa (patch)
tree94497c5cef27e9d4a08593833efeebd17c8ac13d
parent609339c123843ace16d6b17f10205cd61460ab02 (diff)
NFSv3/acl: forget acl cache after setattr
Sync of ACL with std permissions fail,We need to forget the ACL cache after setattr. Reproduction: #!/bin/bash touch testfile cat <<EOF >testfile #!/bin/bash echo "Test was executed" EOF chmod u=rwx testfile chmod g=rw- testfile chmod o=r-- testfile chacl u::r--,g::rwx,o:rw- testfile chmod u+w testfile ls -l testfile chacl -l testfile Output: -rw-rwxrw- 1 root root 0 Mar 28 05:29 testfile testfile [u::r--,g::rwx,o::rw-] Signed-off-by: chendt.fnst <chendt.fnst@cn.fujitsu.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Kinglong Mee <Kinglong Mee> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r--fs/nfs/nfs3proc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index cc04d988db7c..eadf1ab31d16 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -138,8 +138,11 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
138 msg.rpc_cred = nfs_file_cred(sattr->ia_file); 138 msg.rpc_cred = nfs_file_cred(sattr->ia_file);
139 nfs_fattr_init(fattr); 139 nfs_fattr_init(fattr);
140 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 140 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
141 if (status == 0) 141 if (status == 0) {
142 if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
143 nfs_zap_acl_cache(inode);
142 nfs_setattr_update_inode(inode, sattr, fattr); 144 nfs_setattr_update_inode(inode, sattr, fattr);
145 }
143 dprintk("NFS reply setattr: %d\n", status); 146 dprintk("NFS reply setattr: %d\n", status);
144 return status; 147 return status;
145} 148}