Commit ae8b6253 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Linus Torvalds

[PATCH] nfsd4: no replays on unconfirmed owners

We shouldn't check for replays until after checking whether the open owner is
confirmed.  Clients are allowed to reuse openowners without bumping the seqid.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a525825d
...@@ -1465,8 +1465,16 @@ nfsd4_process_open1(struct nfsd4_open *open) ...@@ -1465,8 +1465,16 @@ nfsd4_process_open1(struct nfsd4_open *open)
sop = find_openstateowner_str(strhashval, open); sop = find_openstateowner_str(strhashval, open);
if (sop) { if (sop) {
open->op_stateowner = sop; open->op_stateowner = sop;
/* check for replay */ if (!sop->so_confirmed) {
if (open->op_seqid == sop->so_seqid - 1){ /* Replace any unconfirmed stateowner without
* even checking for replays */
clp = sop->so_client;
release_stateowner(sop);
} else if (open->op_seqid == sop->so_seqid) {
/* normal case */
goto renew;
} else if (open->op_seqid == sop->so_seqid - 1) {
/* replay */
if (sop->so_replay.rp_buflen) if (sop->so_replay.rp_buflen)
return NFSERR_REPLAY_ME; return NFSERR_REPLAY_ME;
else { else {
...@@ -1480,19 +1488,9 @@ nfsd4_process_open1(struct nfsd4_open *open) ...@@ -1480,19 +1488,9 @@ nfsd4_process_open1(struct nfsd4_open *open)
" replay with no replay cache\n"); " replay with no replay cache\n");
goto renew; goto renew;
} }
} else if (sop->so_confirmed) { } else {
if (open->op_seqid == sop->so_seqid)
goto renew;
status = nfserr_bad_seqid; status = nfserr_bad_seqid;
goto out; goto out;
} else {
/* If we get here, we received an OPEN for an
* unconfirmed nfs4_stateowner. Since the seqid's are
* different, purge the existing nfs4_stateowner, and
* instantiate a new one.
*/
clp = sop->so_client;
release_stateowner(sop);
} }
} else { } else {
/* nfs4_stateowner not found. /* nfs4_stateowner not found.
......
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