diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-28 16:05:03 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 15:42:40 -0400 |
commit | e144cbcc251f16c1a14b9256cda73ab4aebe933a (patch) | |
tree | 4ca37ff9816b9b38277a881429176b804422fe21 /fs/nfs | |
parent | 9e907fec6ef7705ba07e22f034dacf102d29a538 (diff) |
NFSv4: Retrieve attributes _before_ calling delegreturn
In order to retrieve cache consistency attributes before
anyone else has a chance to change the inode, we need to
put the GETATTR op _before_ the DELEGRETURN op.
We can then use that as part of a 'nfs_post_op_update_inode_force_wcc()'
call, to ensure that we update the attributes without clearing our
cached data.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 7 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 111a3cc657c1..2e0fbff37d1f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4138,9 +4138,10 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co | |||
4138 | if (status != 0) | 4138 | if (status != 0) |
4139 | goto out; | 4139 | goto out; |
4140 | status = data->rpc_status; | 4140 | status = data->rpc_status; |
4141 | if (status != 0) | 4141 | if (status == 0) |
4142 | goto out; | 4142 | nfs_post_op_update_inode_force_wcc(inode, &data->fattr); |
4143 | nfs_refresh_inode(inode, &data->fattr); | 4143 | else |
4144 | nfs_refresh_inode(inode, &data->fattr); | ||
4144 | out: | 4145 | out: |
4145 | rpc_put_task(task); | 4146 | rpc_put_task(task); |
4146 | return status; | 4147 | return status; |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index fe6142417dd9..ac7a3b014d99 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -2602,8 +2602,8 @@ static void nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, | |||
2602 | encode_compound_hdr(xdr, req, &hdr); | 2602 | encode_compound_hdr(xdr, req, &hdr); |
2603 | encode_sequence(xdr, &args->seq_args, &hdr); | 2603 | encode_sequence(xdr, &args->seq_args, &hdr); |
2604 | encode_putfh(xdr, args->fhandle, &hdr); | 2604 | encode_putfh(xdr, args->fhandle, &hdr); |
2605 | encode_delegreturn(xdr, args->stateid, &hdr); | ||
2606 | encode_getfattr(xdr, args->bitmask, &hdr); | 2605 | encode_getfattr(xdr, args->bitmask, &hdr); |
2606 | encode_delegreturn(xdr, args->stateid, &hdr); | ||
2607 | encode_nops(&hdr); | 2607 | encode_nops(&hdr); |
2608 | } | 2608 | } |
2609 | 2609 | ||
@@ -6527,10 +6527,10 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, | |||
6527 | status = decode_putfh(xdr); | 6527 | status = decode_putfh(xdr); |
6528 | if (status != 0) | 6528 | if (status != 0) |
6529 | goto out; | 6529 | goto out; |
6530 | status = decode_delegreturn(xdr); | 6530 | status = decode_getfattr(xdr, res->fattr, res->server); |
6531 | if (status != 0) | 6531 | if (status != 0) |
6532 | goto out; | 6532 | goto out; |
6533 | decode_getfattr(xdr, res->fattr, res->server); | 6533 | status = decode_delegreturn(xdr); |
6534 | out: | 6534 | out: |
6535 | return status; | 6535 | return status; |
6536 | } | 6536 | } |