Commit 08e8987c authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: setclientid_confirm gotoectomy

Change from "goto" to "else if" format in setclientid_confirm.

From: Fred Isaman
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 22de4d83
...@@ -891,14 +891,13 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -891,14 +891,13 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
status = nfs_ok; status = nfs_ok;
} }
goto out;
} }
/* CASE 2: /* CASE 2:
* conf record that matches input clientid. * conf record that matches input clientid.
* if unconf record that matches input clientid, then unconf->cl_name * if unconf record that matches input clientid, then unconf->cl_name
* or unconf->cl_verifier don't match the conf record. * or unconf->cl_verifier don't match the conf record.
*/ */
if ((conf && !unconf) || else if ((conf && !unconf) ||
((conf && unconf) && ((conf && unconf) &&
(!cmp_verf(&conf->cl_verifier, &unconf->cl_verifier) || (!cmp_verf(&conf->cl_verifier, &unconf->cl_verifier) ||
!same_name(conf->cl_recdir, unconf->cl_recdir)))) { !same_name(conf->cl_recdir, unconf->cl_recdir)))) {
...@@ -908,14 +907,13 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -908,14 +907,13 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
clp = conf; clp = conf;
status = nfs_ok; status = nfs_ok;
} }
goto out;
} }
/* CASE 3: /* CASE 3:
* conf record not found. * conf record not found.
* unconf record found. * unconf record found.
* unconf->cl_confirm matches input confirm * unconf->cl_confirm matches input confirm
*/ */
if (!conf && unconf && cmp_verf(&unconf->cl_confirm, &confirm)) { else if (!conf && unconf && cmp_verf(&unconf->cl_confirm, &confirm)) {
if (!cmp_creds(&unconf->cl_cred, &rqstp->rq_cred)) { if (!cmp_creds(&unconf->cl_cred, &rqstp->rq_cred)) {
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
} else { } else {
...@@ -930,7 +928,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -930,7 +928,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
move_to_confirmed(unconf); move_to_confirmed(unconf);
status = nfs_ok; status = nfs_ok;
} }
goto out;
} }
/* CASE 4: /* CASE 4:
* conf record not found, or if conf, then conf->cl_confirm does not * conf record not found, or if conf, then conf->cl_confirm does not
...@@ -938,14 +935,14 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -938,14 +935,14 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
* unconf record not found, or if unconf, then unconf->cl_confirm * unconf record not found, or if unconf, then unconf->cl_confirm
* does not match input confirm. * does not match input confirm.
*/ */
if ((!conf || (conf && !cmp_verf(&conf->cl_confirm, &confirm))) && else if ((!conf || (conf && !cmp_verf(&conf->cl_confirm, &confirm))) &&
(!unconf || (unconf && !cmp_verf(&unconf->cl_confirm, &confirm)))) { (!unconf || (unconf && !cmp_verf(&unconf->cl_confirm, &confirm)))) {
status = nfserr_stale_clientid; status = nfserr_stale_clientid;
goto out;
} }
/* check that we have hit one of the cases...*/ else {
status = nfserr_clid_inuse; /* check that we have hit one of the cases...*/
goto out; status = nfserr_clid_inuse;
}
out: out:
if (!status) if (!status)
nfsd4_probe_callback(clp); nfsd4_probe_callback(clp);
......
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