nfsd4: eliminate impossible open replay case
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 25 Aug 2011 22:17:52 +0000 (18:17 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 1 Sep 2011 11:29:01 +0000 (07:29 -0400)
If open fails with any error other than nfserr_replay_me, then the main
nfsd4_proc_compound() loop continues unconditionally to
nfsd4_encode_operation(), which will always call encode_seqid_op_tail.
Thus the condition we check for here does not occur.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 6cf729a096c3b67b4e195305c2a4f4de4e7abd86..26b0c75aa93ba1402d446ef47851e535d5d9e53d 100644 (file)
@@ -2495,18 +2495,8 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
                open->op_stateowner = NULL;
                goto renew;
        }
-       if (open->op_seqid == sop->so_seqid - 1) {
-               if (sop->so_replay.rp_buflen)
-                       return nfserr_replay_me;
-               /* The original OPEN failed so spectacularly
-                * that we don't even have replay data saved!
-                * Therefore, we have no choice but to continue
-                * processing this OPEN; presumably, we'll
-                * fail again for the same reason.
-                */
-               dprintk("nfsd4_process_open1: replay with no replay cache\n");
-               goto renew;
-       }
+       if (open->op_seqid == sop->so_seqid - 1)
+               return nfserr_replay_me;
        if (open->op_seqid != sop->so_seqid)
                return nfserr_bad_seqid;
 renew: