All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv3/acl: forget acl cache after setattr
@ 2018-03-28 10:12 chendt
  2018-03-28 20:48 ` Benjamin Coddington
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: chendt @ 2018-03-28 10:12 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust

Sync of ACL with std permissions fail,do 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 -ln 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>
---
 fs/nfs/nfs3proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 7327930..ef3e17c 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -140,6 +140,7 @@
 	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
 	if (status == 0)
 		nfs_setattr_update_inode(inode, sattr, fattr);
+		forget_all_cached_acls(inode);
 	dprintk("NFS reply setattr: %d\n", status);
 	return status;
 }
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] NFSv3/acl: forget acl cache after setattr
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Benjamin Coddington @ 2018-03-28 20:48 UTC (permalink / raw)
  To: chendt; +Cc: linux-nfs, Trond Myklebust

I'm seeing this on xfstests generic/099 as well. Do we want to use 
nfs_zap_acl_cache() instead so that we clear NFS_INO_INVALID_ACL?

Ben

On 28 Mar 2018, at 6:12, chendt wrote:

> Sync of ACL with std permissions fail,do 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 -ln 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>
> ---
>  fs/nfs/nfs3proc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
> index 7327930..ef3e17c 100644
> --- a/fs/nfs/nfs3proc.c
> +++ b/fs/nfs/nfs3proc.c
> @@ -140,6 +140,7 @@
>  	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
>  	if (status == 0)
>  		nfs_setattr_update_inode(inode, sattr, fattr);
> +		forget_all_cached_acls(inode);
>  	dprintk("NFS reply setattr: %d\n", status);
>  	return status;
>  }
> -- 
> 1.8.3.1
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] NFSv3/acl: forget acl cache after setattr
  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 ` chendt
  2018-03-29  6:47   ` Kinglong Mee
  2018-03-29  8:13 ` [PATCH v3] " chendt
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: chendt @ 2018-03-29  6:01 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust, Benjamin Coddington

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);
 	dprintk("NFS reply setattr: %d\n", status);
 	return status;
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] NFSv3/acl: forget acl cache after setattr
  2018-03-29  6:01 ` [PATCH v2] " chendt
@ 2018-03-29  6:47   ` Kinglong Mee
  0 siblings, 0 replies; 7+ messages in thread
From: Kinglong Mee @ 2018-03-29  6:47 UTC (permalink / raw)
  To: chendt, linux-nfs; +Cc: Trond Myklebust, Benjamin Coddington



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;
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] NFSv3/acl: forget acl cache after setattr
  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  8:13 ` chendt
  2018-03-29 10:07 ` [PATCH] " kbuild test robot
  2018-03-29 11:39 ` kbuild test robot
  4 siblings, 0 replies; 7+ messages in thread
From: chendt @ 2018-03-29  8:13 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond Myklebust, Benjamin Coddington, Kinglong Mee

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>

---
 fs/nfs/nfs3proc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 7327930..29b6dbd 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -138,8 +138,11 @@
 		msg.rpc_cred = nfs_file_cred(sattr->ia_file);
 	nfs_fattr_init(fattr);
 	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
-	if (status == 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);
+	}
 	dprintk("NFS reply setattr: %d\n", status);
 	return status;
 }
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] NFSv3/acl: forget acl cache after setattr
  2018-03-28 10:12 [PATCH] NFSv3/acl: forget acl cache after setattr chendt
                   ` (2 preceding siblings ...)
  2018-03-29  8:13 ` [PATCH v3] " chendt
@ 2018-03-29 10:07 ` kbuild test robot
  2018-03-29 11:39 ` kbuild test robot
  4 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2018-03-29 10:07 UTC (permalink / raw)
  To: chendt; +Cc: kbuild-all, linux-nfs, Trond Myklebust

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

Hi chendt,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v4.16-rc7 next-20180328]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/chendt/NFSv3-acl-forget-acl-cache-after-setattr/20180329-173503
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: x86_64-randconfig-x010-201812 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   fs/nfs/nfs3proc.c: In function 'nfs3_proc_setattr':
>> fs/nfs/nfs3proc.c:141:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (status == 0)
     ^~
   fs/nfs/nfs3proc.c:143:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      forget_all_cached_acls(inode);
      ^~~~~~~~~~~~~~~~~~~~~~

vim +/if +141 fs/nfs/nfs3proc.c

^1da177e Linus Torvalds  2005-04-16  119  
^1da177e Linus Torvalds  2005-04-16  120  static int
^1da177e Linus Torvalds  2005-04-16  121  nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
^1da177e Linus Torvalds  2005-04-16  122  			struct iattr *sattr)
^1da177e Linus Torvalds  2005-04-16  123  {
2b0143b5 David Howells   2015-03-17  124  	struct inode *inode = d_inode(dentry);
^1da177e Linus Torvalds  2005-04-16  125  	struct nfs3_sattrargs	arg = {
^1da177e Linus Torvalds  2005-04-16  126  		.fh		= NFS_FH(inode),
^1da177e Linus Torvalds  2005-04-16  127  		.sattr		= sattr,
^1da177e Linus Torvalds  2005-04-16  128  	};
dead28da Chuck Lever     2006-03-20  129  	struct rpc_message msg = {
dead28da Chuck Lever     2006-03-20  130  		.rpc_proc	= &nfs3_procedures[NFS3PROC_SETATTR],
dead28da Chuck Lever     2006-03-20  131  		.rpc_argp	= &arg,
dead28da Chuck Lever     2006-03-20  132  		.rpc_resp	= fattr,
dead28da Chuck Lever     2006-03-20  133  	};
^1da177e Linus Torvalds  2005-04-16  134  	int	status;
^1da177e Linus Torvalds  2005-04-16  135  
^1da177e Linus Torvalds  2005-04-16  136  	dprintk("NFS call  setattr\n");
659bfcd6 Trond Myklebust 2008-06-10  137  	if (sattr->ia_valid & ATTR_FILE)
659bfcd6 Trond Myklebust 2008-06-10  138  		msg.rpc_cred = nfs_file_cred(sattr->ia_file);
0e574af1 Trond Myklebust 2005-10-27  139  	nfs_fattr_init(fattr);
dead28da Chuck Lever     2006-03-20  140  	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
65e4308d Trond Myklebust 2005-08-16 @141  	if (status == 0)
f044636d Trond Myklebust 2015-02-26  142  		nfs_setattr_update_inode(inode, sattr, fattr);
34de94ef chendt          2018-03-28  143  		forget_all_cached_acls(inode);
^1da177e Linus Torvalds  2005-04-16  144  	dprintk("NFS reply setattr: %d\n", status);
^1da177e Linus Torvalds  2005-04-16  145  	return status;
^1da177e Linus Torvalds  2005-04-16  146  }
^1da177e Linus Torvalds  2005-04-16  147  

:::::: The code at line 141 was first introduced by commit
:::::: 65e4308d2500e7daf60c3dccc202c61ffb066c63 [PATCH] NFS: Ensure we always update inode->i_mode when doing O_EXCL creates

:::::: TO: Trond Myklebust <Trond.Myklebust@netapp.com>
:::::: CC: Linus Torvalds <torvalds@g5.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30142 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] NFSv3/acl: forget acl cache after setattr
  2018-03-28 10:12 [PATCH] NFSv3/acl: forget acl cache after setattr chendt
                   ` (3 preceding siblings ...)
  2018-03-29 10:07 ` [PATCH] " kbuild test robot
@ 2018-03-29 11:39 ` kbuild test robot
  4 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2018-03-29 11:39 UTC (permalink / raw)
  To: chendt; +Cc: kbuild-all, linux-nfs, Trond Myklebust

[-- Attachment #1: Type: text/plain, Size: 12187 bytes --]

Hi chendt,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v4.16-rc7 next-20180328]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/chendt/NFSv3-acl-forget-acl-cache-after-setattr/20180329-173503
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: x86_64-randconfig-x019-201812 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:5:0,
                    from arch/x86/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from fs/nfs/nfs3proc.c:10:
   fs/nfs/nfs3proc.c: In function 'nfs3_proc_setattr':
   include/linux/compiler.h:58:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
     ^
   include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
>> fs/nfs/nfs3proc.c:141:2: note: in expansion of macro 'if'
     if (status == 0)
     ^~
   fs/nfs/nfs3proc.c:143:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      forget_all_cached_acls(inode);
      ^~~~~~~~~~~~~~~~~~~~~~

vim +/if +141 fs/nfs/nfs3proc.c

^1da177e4 Linus Torvalds      2005-04-16  @10  #include <linux/mm.h>
^1da177e4 Linus Torvalds      2005-04-16   11  #include <linux/errno.h>
^1da177e4 Linus Torvalds      2005-04-16   12  #include <linux/string.h>
^1da177e4 Linus Torvalds      2005-04-16   13  #include <linux/sunrpc/clnt.h>
5a0e3ad6a Tejun Heo           2010-03-24   14  #include <linux/slab.h>
^1da177e4 Linus Torvalds      2005-04-16   15  #include <linux/nfs.h>
^1da177e4 Linus Torvalds      2005-04-16   16  #include <linux/nfs3.h>
^1da177e4 Linus Torvalds      2005-04-16   17  #include <linux/nfs_fs.h>
^1da177e4 Linus Torvalds      2005-04-16   18  #include <linux/nfs_page.h>
^1da177e4 Linus Torvalds      2005-04-16   19  #include <linux/lockd/bind.h>
b7fa0554c Andreas Gruenbacher 2005-06-22   20  #include <linux/nfs_mount.h>
d310310cb Jeff Layton         2011-12-01   21  #include <linux/freezer.h>
0a6be6555 Tejun Heo           2014-02-03   22  #include <linux/xattr.h>
^1da177e4 Linus Torvalds      2005-04-16   23  
006ea73e5 Chuck Lever         2006-03-20   24  #include "iostat.h"
f7b422b17 David Howells       2006-06-09   25  #include "internal.h"
00a36a109 Anna Schumaker      2014-09-03   26  #include "nfs3_fs.h"
006ea73e5 Chuck Lever         2006-03-20   27  
^1da177e4 Linus Torvalds      2005-04-16   28  #define NFSDBG_FACILITY		NFSDBG_PROC
^1da177e4 Linus Torvalds      2005-04-16   29  
eb96d5c97 Andy Adamson        2012-11-27   30  /* A wrapper to handle the EJUKEBOX error messages */
^1da177e4 Linus Torvalds      2005-04-16   31  static int
^1da177e4 Linus Torvalds      2005-04-16   32  nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
^1da177e4 Linus Torvalds      2005-04-16   33  {
^1da177e4 Linus Torvalds      2005-04-16   34  	int res;
^1da177e4 Linus Torvalds      2005-04-16   35  	do {
^1da177e4 Linus Torvalds      2005-04-16   36  		res = rpc_call_sync(clnt, msg, flags);
eb96d5c97 Andy Adamson        2012-11-27   37  		if (res != -EJUKEBOX)
^1da177e4 Linus Torvalds      2005-04-16   38  			break;
416ad3c9c Colin Cross         2013-05-06   39  		freezable_schedule_timeout_killable_unsafe(NFS_JUKEBOX_RETRY_TIME);
^1da177e4 Linus Torvalds      2005-04-16   40  		res = -ERESTARTSYS;
150030b78 Matthew Wilcox      2007-12-06   41  	} while (!fatal_signal_pending(current));
^1da177e4 Linus Torvalds      2005-04-16   42  	return res;
^1da177e4 Linus Torvalds      2005-04-16   43  }
^1da177e4 Linus Torvalds      2005-04-16   44  
dead28da8 Chuck Lever         2006-03-20   45  #define rpc_call_sync(clnt, msg, flags)	nfs3_rpc_wrapper(clnt, msg, flags)
^1da177e4 Linus Torvalds      2005-04-16   46  
^1da177e4 Linus Torvalds      2005-04-16   47  static int
006ea73e5 Chuck Lever         2006-03-20   48  nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode)
^1da177e4 Linus Torvalds      2005-04-16   49  {
eb96d5c97 Andy Adamson        2012-11-27   50  	if (task->tk_status != -EJUKEBOX)
^1da177e4 Linus Torvalds      2005-04-16   51  		return 0;
b68d69b8c Jeff Layton         2010-01-07   52  	if (task->tk_status == -EJUKEBOX)
006ea73e5 Chuck Lever         2006-03-20   53  		nfs_inc_stats(inode, NFSIOS_DELAY);
^1da177e4 Linus Torvalds      2005-04-16   54  	task->tk_status = 0;
^1da177e4 Linus Torvalds      2005-04-16   55  	rpc_restart_call(task);
^1da177e4 Linus Torvalds      2005-04-16   56  	rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
^1da177e4 Linus Torvalds      2005-04-16   57  	return 1;
^1da177e4 Linus Torvalds      2005-04-16   58  }
^1da177e4 Linus Torvalds      2005-04-16   59  
^1da177e4 Linus Torvalds      2005-04-16   60  static int
03c217339 J. Bruce Fields     2006-01-03   61  do_proc_get_root(struct rpc_clnt *client, struct nfs_fh *fhandle,
^1da177e4 Linus Torvalds      2005-04-16   62  		 struct nfs_fsinfo *info)
^1da177e4 Linus Torvalds      2005-04-16   63  {
dead28da8 Chuck Lever         2006-03-20   64  	struct rpc_message msg = {
dead28da8 Chuck Lever         2006-03-20   65  		.rpc_proc	= &nfs3_procedures[NFS3PROC_FSINFO],
dead28da8 Chuck Lever         2006-03-20   66  		.rpc_argp	= fhandle,
dead28da8 Chuck Lever         2006-03-20   67  		.rpc_resp	= info,
dead28da8 Chuck Lever         2006-03-20   68  	};
^1da177e4 Linus Torvalds      2005-04-16   69  	int	status;
^1da177e4 Linus Torvalds      2005-04-16   70  
3110ff804 Harvey Harrison     2008-05-02   71  	dprintk("%s: call  fsinfo\n", __func__);
0e574af1b Trond Myklebust     2005-10-27   72  	nfs_fattr_init(info->fattr);
dead28da8 Chuck Lever         2006-03-20   73  	status = rpc_call_sync(client, &msg, 0);
3110ff804 Harvey Harrison     2008-05-02   74  	dprintk("%s: reply fsinfo: %d\n", __func__, status);
086600430 Trond Myklebust     2012-08-20   75  	if (status == 0 && !(info->fattr->valid & NFS_ATTR_FATTR)) {
dead28da8 Chuck Lever         2006-03-20   76  		msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
dead28da8 Chuck Lever         2006-03-20   77  		msg.rpc_resp = info->fattr;
dead28da8 Chuck Lever         2006-03-20   78  		status = rpc_call_sync(client, &msg, 0);
3110ff804 Harvey Harrison     2008-05-02   79  		dprintk("%s: reply getattr: %d\n", __func__, status);
^1da177e4 Linus Torvalds      2005-04-16   80  	}
^1da177e4 Linus Torvalds      2005-04-16   81  	return status;
^1da177e4 Linus Torvalds      2005-04-16   82  }
^1da177e4 Linus Torvalds      2005-04-16   83  
^1da177e4 Linus Torvalds      2005-04-16   84  /*
54ceac451 David Howells       2006-08-22   85   * Bare-bones access to getattr: this is for nfs_get_root/nfs_get_sb
03c217339 J. Bruce Fields     2006-01-03   86   */
03c217339 J. Bruce Fields     2006-01-03   87  static int
03c217339 J. Bruce Fields     2006-01-03   88  nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
03c217339 J. Bruce Fields     2006-01-03   89  		   struct nfs_fsinfo *info)
03c217339 J. Bruce Fields     2006-01-03   90  {
03c217339 J. Bruce Fields     2006-01-03   91  	int	status;
03c217339 J. Bruce Fields     2006-01-03   92  
03c217339 J. Bruce Fields     2006-01-03   93  	status = do_proc_get_root(server->client, fhandle, info);
5006a76cc David Howells       2006-08-22   94  	if (status && server->nfs_client->cl_rpcclient != server->client)
5006a76cc David Howells       2006-08-22   95  		status = do_proc_get_root(server->nfs_client->cl_rpcclient, fhandle, info);
03c217339 J. Bruce Fields     2006-01-03   96  	return status;
03c217339 J. Bruce Fields     2006-01-03   97  }
03c217339 J. Bruce Fields     2006-01-03   98  
03c217339 J. Bruce Fields     2006-01-03   99  /*
^1da177e4 Linus Torvalds      2005-04-16  100   * One function for each procedure in the NFS protocol.
^1da177e4 Linus Torvalds      2005-04-16  101   */
^1da177e4 Linus Torvalds      2005-04-16  102  static int
^1da177e4 Linus Torvalds      2005-04-16  103  nfs3_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
1775fd3e8 David Quigley       2013-05-22  104  		struct nfs_fattr *fattr, struct nfs4_label *label)
^1da177e4 Linus Torvalds      2005-04-16  105  {
dead28da8 Chuck Lever         2006-03-20  106  	struct rpc_message msg = {
dead28da8 Chuck Lever         2006-03-20  107  		.rpc_proc	= &nfs3_procedures[NFS3PROC_GETATTR],
dead28da8 Chuck Lever         2006-03-20  108  		.rpc_argp	= fhandle,
dead28da8 Chuck Lever         2006-03-20  109  		.rpc_resp	= fattr,
dead28da8 Chuck Lever         2006-03-20  110  	};
^1da177e4 Linus Torvalds      2005-04-16  111  	int	status;
^1da177e4 Linus Torvalds      2005-04-16  112  
^1da177e4 Linus Torvalds      2005-04-16  113  	dprintk("NFS call  getattr\n");
0e574af1b Trond Myklebust     2005-10-27  114  	nfs_fattr_init(fattr);
dead28da8 Chuck Lever         2006-03-20  115  	status = rpc_call_sync(server->client, &msg, 0);
^1da177e4 Linus Torvalds      2005-04-16  116  	dprintk("NFS reply getattr: %d\n", status);
^1da177e4 Linus Torvalds      2005-04-16  117  	return status;
^1da177e4 Linus Torvalds      2005-04-16  118  }
^1da177e4 Linus Torvalds      2005-04-16  119  
^1da177e4 Linus Torvalds      2005-04-16  120  static int
^1da177e4 Linus Torvalds      2005-04-16  121  nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
^1da177e4 Linus Torvalds      2005-04-16  122  			struct iattr *sattr)
^1da177e4 Linus Torvalds      2005-04-16  123  {
2b0143b5c David Howells       2015-03-17  124  	struct inode *inode = d_inode(dentry);
^1da177e4 Linus Torvalds      2005-04-16  125  	struct nfs3_sattrargs	arg = {
^1da177e4 Linus Torvalds      2005-04-16  126  		.fh		= NFS_FH(inode),
^1da177e4 Linus Torvalds      2005-04-16  127  		.sattr		= sattr,
^1da177e4 Linus Torvalds      2005-04-16  128  	};
dead28da8 Chuck Lever         2006-03-20  129  	struct rpc_message msg = {
dead28da8 Chuck Lever         2006-03-20  130  		.rpc_proc	= &nfs3_procedures[NFS3PROC_SETATTR],
dead28da8 Chuck Lever         2006-03-20  131  		.rpc_argp	= &arg,
dead28da8 Chuck Lever         2006-03-20  132  		.rpc_resp	= fattr,
dead28da8 Chuck Lever         2006-03-20  133  	};
^1da177e4 Linus Torvalds      2005-04-16  134  	int	status;
^1da177e4 Linus Torvalds      2005-04-16  135  
^1da177e4 Linus Torvalds      2005-04-16  136  	dprintk("NFS call  setattr\n");
659bfcd6d Trond Myklebust     2008-06-10  137  	if (sattr->ia_valid & ATTR_FILE)
659bfcd6d Trond Myklebust     2008-06-10  138  		msg.rpc_cred = nfs_file_cred(sattr->ia_file);
0e574af1b Trond Myklebust     2005-10-27  139  	nfs_fattr_init(fattr);
dead28da8 Chuck Lever         2006-03-20  140  	status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
65e4308d2 Trond Myklebust     2005-08-16 @141  	if (status == 0)
f044636d9 Trond Myklebust     2015-02-26  142  		nfs_setattr_update_inode(inode, sattr, fattr);
34de94ef5 chendt              2018-03-28  143  		forget_all_cached_acls(inode);
^1da177e4 Linus Torvalds      2005-04-16  144  	dprintk("NFS reply setattr: %d\n", status);
^1da177e4 Linus Torvalds      2005-04-16  145  	return status;
^1da177e4 Linus Torvalds      2005-04-16  146  }
^1da177e4 Linus Torvalds      2005-04-16  147  

:::::: The code at line 141 was first introduced by commit
:::::: 65e4308d2500e7daf60c3dccc202c61ffb066c63 [PATCH] NFS: Ensure we always update inode->i_mode when doing O_EXCL creates

:::::: TO: Trond Myklebust <Trond.Myklebust@netapp.com>
:::::: CC: Linus Torvalds <torvalds@g5.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30041 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-29 11:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.