Commit e144cbcc authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9e907fec
...@@ -4138,9 +4138,10 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co ...@@ -4138,9 +4138,10 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
if (status != 0) if (status != 0)
goto out; goto out;
status = data->rpc_status; status = data->rpc_status;
if (status != 0) if (status == 0)
goto out; nfs_post_op_update_inode_force_wcc(inode, &data->fattr);
nfs_refresh_inode(inode, &data->fattr); else
nfs_refresh_inode(inode, &data->fattr);
out: out:
rpc_put_task(task); rpc_put_task(task);
return status; return status;
......
...@@ -2602,8 +2602,8 @@ static void nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, ...@@ -2602,8 +2602,8 @@ static void nfs4_xdr_enc_delegreturn(struct rpc_rqst *req,
encode_compound_hdr(xdr, req, &hdr); encode_compound_hdr(xdr, req, &hdr);
encode_sequence(xdr, &args->seq_args, &hdr); encode_sequence(xdr, &args->seq_args, &hdr);
encode_putfh(xdr, args->fhandle, &hdr); encode_putfh(xdr, args->fhandle, &hdr);
encode_delegreturn(xdr, args->stateid, &hdr);
encode_getfattr(xdr, args->bitmask, &hdr); encode_getfattr(xdr, args->bitmask, &hdr);
encode_delegreturn(xdr, args->stateid, &hdr);
encode_nops(&hdr); encode_nops(&hdr);
} }
...@@ -6527,10 +6527,10 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, ...@@ -6527,10 +6527,10 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp,
status = decode_putfh(xdr); status = decode_putfh(xdr);
if (status != 0) if (status != 0)
goto out; goto out;
status = decode_delegreturn(xdr); status = decode_getfattr(xdr, res->fattr, res->server);
if (status != 0) if (status != 0)
goto out; goto out;
decode_getfattr(xdr, res->fattr, res->server); status = decode_delegreturn(xdr);
out: out:
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment