]> git.neil.brown.name Git - history.git/commitdiff
NFSv4: don't retry CREATE operations if the server returns
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 15:20:15 +0000 (11:20 -0400)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 15:20:15 +0000 (11:20 -0400)
   NFS4ERR_DELAY on the GETATTR call.

fs/nfs/nfs4xdr.c

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