Commit 26ee7f10 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: don't retry CREATE operations if the server returns

   NFS4ERR_DELAY on the GETATTR call.
parent 90c1f6b2
...@@ -1253,9 +1253,9 @@ static int nfs4_xdr_enc_create(struct rpc_rqst *req, uint32_t *p, const struct n ...@@ -1253,9 +1253,9 @@ static int nfs4_xdr_enc_create(struct rpc_rqst *req, uint32_t *p, const struct n
goto out; goto out;
if ((status = encode_create(&xdr, args)) != 0) if ((status = encode_create(&xdr, args)) != 0)
goto out; goto out;
if ((status = encode_getfattr(&xdr, args->bitmask)) != 0) if ((status = encode_getfh(&xdr)) != 0)
goto out; goto out;
status = encode_getfh(&xdr); status = encode_getfattr(&xdr, args->bitmask);
out: out:
return status; return status;
} }
...@@ -1326,10 +1326,10 @@ static int nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_opena ...@@ -1326,10 +1326,10 @@ static int nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_opena
status = encode_open(&xdr, args); status = encode_open(&xdr, args);
if (status) if (status)
goto out; goto out;
status = encode_getfattr(&xdr, args->bitmask); status = encode_getfh(&xdr);
if (status) if (status)
goto out; goto out;
status = encode_getfh(&xdr); status = encode_getfattr(&xdr, args->bitmask);
out: out:
return status; return status;
} }
...@@ -3221,9 +3221,11 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_ ...@@ -3221,9 +3221,11 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_
goto out; goto out;
if ((status = decode_create(&xdr,&res->dir_cinfo)) != 0) if ((status = decode_create(&xdr,&res->dir_cinfo)) != 0)
goto out; goto out;
if ((status = decode_getfattr(&xdr, res->fattr, res->server)) != 0) if ((status = decode_getfh(&xdr, res->fh)) != 0)
goto out; goto out;
status = decode_getfh(&xdr, res->fh); status = decode_getfattr(&xdr, res->fattr, res->server);
if (status == NFS4ERR_DELAY)
status = 0;
out: out:
return status; return status;
} }
...@@ -3297,12 +3299,14 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_ope ...@@ -3297,12 +3299,14 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_ope
if (status) if (status)
goto out; goto out;
status = decode_open(&xdr, res); status = decode_open(&xdr, res);
if (status)
goto out;
status = decode_getfattr(&xdr, res->f_attr, res->server);
if (status) if (status)
goto out; goto out;
status = decode_getfh(&xdr, &res->fh); status = decode_getfh(&xdr, &res->fh);
if (status)
goto out;
status = decode_getfattr(&xdr, res->f_attr, res->server);
if (status == NFS4ERR_DELAY)
status = 0;
out: out:
return status; return status;
} }
...@@ -3348,6 +3352,8 @@ static int nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct ...@@ -3348,6 +3352,8 @@ static int nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct
if (status) if (status)
goto out; goto out;
status = decode_getfattr(&xdr, res->f_attr, res->server); status = decode_getfattr(&xdr, res->f_attr, res->server);
if (status == NFS4ERR_DELAY)
status = 0;
out: out:
return status; return status;
} }
...@@ -3372,6 +3378,8 @@ static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_ ...@@ -3372,6 +3378,8 @@ static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_
if (status) if (status)
goto out; goto out;
status = decode_getfattr(&xdr, res->fattr, res->server); status = decode_getfattr(&xdr, res->fattr, res->server);
if (status == NFS4ERR_DELAY)
status = 0;
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