Commit bc6f8b88 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: miscellaneous open cleanup 2

Replace sequence of if {...  goto} 's by if-elseif's, other minor
simplification of logic.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent da0c38ec
...@@ -1464,7 +1464,9 @@ nfsd4_process_open1(struct nfsd4_open *open) ...@@ -1464,7 +1464,9 @@ nfsd4_process_open1(struct nfsd4_open *open)
open->op_stateowner = sop; open->op_stateowner = sop;
/* check for replay */ /* check for replay */
if (open->op_seqid == sop->so_seqid){ if (open->op_seqid == sop->so_seqid){
if (!sop->so_replay.rp_buflen) { if (sop->so_replay.rp_buflen)
return NFSERR_REPLAY_ME;
else {
/* The original OPEN failed so spectacularly /* The original OPEN failed so spectacularly
* that we don't even have replay data saved! * that we don't even have replay data saved!
* Therefore, we have no choice but to continue * Therefore, we have no choice but to continue
...@@ -1476,37 +1478,32 @@ nfsd4_process_open1(struct nfsd4_open *open) ...@@ -1476,37 +1478,32 @@ nfsd4_process_open1(struct nfsd4_open *open)
status = NFS_OK; status = NFS_OK;
goto renew; goto renew;
} }
status = NFSERR_REPLAY_ME; } else if (sop->so_confirmed) {
return status;
}
if (sop->so_confirmed) {
if (open->op_seqid == sop->so_seqid + 1) { if (open->op_seqid == sop->so_seqid + 1) {
status = nfs_ok; status = nfs_ok;
goto renew; 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);
} }
/* If we get here, we received an OPEN for an unconfirmed } else {
* nfs4_stateowner. /* nfs4_stateowner not found.
* Since the sequid's are different, purge the * Verify clientid and instantiate new nfs4_stateowner.
* existing nfs4_stateowner, and instantiate a new one. * If verify fails this is presumably the result of the
* client's lease expiring.
*/ */
clp = sop->so_client; status = nfserr_expired;
release_stateowner(sop); if (!verify_clientid(&clp, clientid))
goto instantiate_new_owner; goto out;
} }
/* nfs4_stateowner not found.
* verify clientid and instantiate new nfs4_stateowner
* if verify fails this is presumably the result of the
* client's lease expiring.
*
* XXX compare clp->cl_addr with rqstp addr?
*/
status = nfserr_expired;
if (!verify_clientid(&clp, clientid))
goto out;
instantiate_new_owner:
status = nfserr_resource; status = nfserr_resource;
if (!(sop = alloc_init_open_stateowner(strhashval, clp, open))) if (!(sop = alloc_init_open_stateowner(strhashval, clp, open)))
goto out; goto out;
......
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