summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-17 21:52:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-19 15:09:03 -0400
commit9936781d0147e13cbc6df02f5265e0b9999ce3cf (patch)
treea24b01b576cd04f5eb6b9f61da5cfed650d50603 /fs/nfs/nfs4xdr.c
parent56659e9926ef5996398924c799ecac39ca8b6223 (diff)
NFSv4: Try to recover from getfh failures in nfs4_xdr_dec_open
Try harder to recover the open state if the server failed to return a filehandle. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 99a123db1083..af959147077b 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3161,11 +3161,12 @@ static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh)
uint32_t len;
int status;
+ /* Zero handle first to allow comparisons */
+ memset(fh, 0, sizeof(*fh));
+
status = decode_op_hdr(xdr, OP_GETFH);
if (status)
return status;
- /* Zero handle first to allow comparisons */
- memset(fh, 0, sizeof(*fh));
READ_BUF(4);
READ32(len);
@@ -4030,8 +4031,7 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openr
status = decode_open(&xdr, res);
if (status)
goto out;
- status = decode_getfh(&xdr, &res->fh);
- if (status)
+ if (decode_getfh(&xdr, &res->fh) != 0)
goto out;
if (decode_getfattr(&xdr, res->f_attr, res->server) != 0)
goto out;