linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: chendt <chendt.fnst@cn.fujitsu.com>, linux-nfs@vger.kernel.org
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
	Benjamin Coddington <bcodding@redhat.com>
Subject: Re: [PATCH v2] NFSv3/acl: forget acl cache after setattr
Date: Thu, 29 Mar 2018 14:47:41 +0800	[thread overview]
Message-ID: <54df3c51-73c5-c803-f89c-45f9d4e1c24b@gmail.com> (raw)
In-Reply-To: <2a720d30-6471-5352-56a3-3d615bff5352@cn.fujitsu.com>



On 2018/3/29 14:01, chendt wrote:
> 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>
> ---
>  fs/nfs/nfs3proc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
> index 7327930..fcb0c40 100644
> --- a/fs/nfs/nfs3proc.c
> +++ b/fs/nfs/nfs3proc.c
> @@ -139,6 +139,8 @@
>  	nfs_fattr_init(fattr);
>  	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
>  	if (status == 0)
> +		if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL)
> +			nfs_zap_acl_cache(inode);
>  		nfs_setattr_update_inode(inode, sattr, fattr);

Missing { } after if (status == 0) ?

thanks,
Kinglong Mee

>  	dprintk("NFS reply setattr: %d\n", status);
>  	return status;
> 

  reply	other threads:[~2018-03-29  6:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 10:12 [PATCH] NFSv3/acl: forget acl cache after setattr chendt
2018-03-28 20:48 ` Benjamin Coddington
2018-03-29  6:01 ` [PATCH v2] " chendt
2018-03-29  6:47   ` Kinglong Mee [this message]
2018-03-29  8:13 ` [PATCH v3] " chendt
2018-03-29 10:07 ` [PATCH] " kbuild test robot
2018-03-29 11:39 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54df3c51-73c5-c803-f89c-45f9d4e1c24b@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=bcodding@redhat.com \
    --cc=chendt.fnst@cn.fujitsu.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).