Linux-NFS Archive on
 help / color / Atom feed
* [PATCH] NFSv3: FIx bug when using chacl and chmod to change acl
@ 2019-12-25  3:37 Su Yanjun
  0 siblings, 0 replies; only message in thread
From: Su Yanjun @ 2019-12-25  3:37 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs, linux-kernel

We find a bug when running test under nfsv3  as below.
chacl u::r--,g::rwx,o:rw- file1
chmod u+w file1
chacl -l file1

We expect u::rw-, but it shows u::r--, more likely it returns the
cached acl in inode.

We dig the code find that the code path is different.

Then nfs_zap_acl_cache clears the NFS_INO_INVALID_ACL in

Because NFS_INO_INVALID_ACL has been cleared by chacl path,
nfs_zap_acl_cache wont be called.

nfs_setattr_update_inode will set NFS_INO_INVALID_ACL so let it
before nfs_zap_acl_cache call.

Signed-off-by: Su Yanjun <>
 fs/nfs/nfs3proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 9eb2f1a503ab..6d736f0ac811 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -140,9 +140,9 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
     status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
     if (status == 0) {
+        nfs_setattr_update_inode(inode, sattr, fattr);
         if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
-        nfs_setattr_update_inode(inode, sattr, fattr);
     dprintk("NFS reply setattr: %d\n", status);
     return status;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  3:37 [PATCH] NFSv3: FIx bug when using chacl and chmod to change acl Su Yanjun

Linux-NFS Archive on

Archives are clonable:
	git clone --mirror linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ \
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone