Commit 21ab45a4 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: miscellaneous setclientid_confirm cleanup

Minor cleanup, remove some unnecessary printk's.
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 7c79f737
...@@ -834,7 +834,7 @@ int ...@@ -834,7 +834,7 @@ int
nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confirm *setclientid_confirm) nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confirm *setclientid_confirm)
{ {
u32 ip_addr = rqstp->rq_addr.sin_addr.s_addr; u32 ip_addr = rqstp->rq_addr.sin_addr.s_addr;
struct nfs4_client *clp, *conf = NULL, *unconf = NULL; struct nfs4_client *conf, *unconf;
nfs4_verifier confirm = setclientid_confirm->sc_confirm; nfs4_verifier confirm = setclientid_confirm->sc_confirm;
clientid_t * clid = &setclientid_confirm->sc_clientid; clientid_t * clid = &setclientid_confirm->sc_clientid;
int status; int status;
...@@ -847,28 +847,16 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -847,28 +847,16 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
*/ */
nfs4_lock_state(); nfs4_lock_state();
clp = find_confirmed_client(clid);
if (clp) { conf = find_confirmed_client(clid);
unconf = find_unconfirmed_client(clid);
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
if (clp->cl_addr != ip_addr) { if (conf && conf->cl_addr != ip_addr)
printk("NFSD: setclientid: string in use by client"
"(clientid %08x/%08x)\n",
clp->cl_clientid.cl_boot, clp->cl_clientid.cl_id);
goto out; goto out;
} if (unconf && unconf->cl_addr != ip_addr)
conf = clp;
}
clp = find_unconfirmed_client(clid);
if (clp) {
status = nfserr_clid_inuse;
if (clp->cl_addr != ip_addr) {
printk("NFSD: setclientid: string in use by client"
"(clientid %08x/%08x)\n",
clp->cl_clientid.cl_boot, clp->cl_clientid.cl_id);
goto out; goto out;
}
unconf = clp;
}
if ((conf && unconf) && if ((conf && unconf) &&
(cmp_verf(&unconf->cl_confirm, &confirm)) && (cmp_verf(&unconf->cl_confirm, &confirm)) &&
(cmp_verf(&conf->cl_verifier, &unconf->cl_verifier)) && (cmp_verf(&conf->cl_verifier, &unconf->cl_verifier)) &&
...@@ -884,9 +872,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -884,9 +872,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
else { else {
/* XXX: We just turn off callbacks until we can handle /* XXX: We just turn off callbacks until we can handle
* change request correctly. */ * change request correctly. */
clp = conf; conf->cl_callback.cb_parsed = 0;
clp->cl_callback.cb_parsed = 0; gen_confirm(conf);
gen_confirm(clp);
expire_client(unconf); expire_client(unconf);
status = nfs_ok; status = nfs_ok;
...@@ -901,12 +888,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -901,12 +888,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
* unconf->cl_name or unconf->cl_verifier don't match the * unconf->cl_name or unconf->cl_verifier don't match the
* conf record. * conf record.
*/ */
if (!cmp_creds(&conf->cl_cred,&rqstp->rq_cred)) { if (!cmp_creds(&conf->cl_cred,&rqstp->rq_cred))
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
} else { else
clp = conf;
status = nfs_ok; status = nfs_ok;
}
} else if (!conf && unconf } else if (!conf && unconf
&& cmp_verf(&unconf->cl_confirm, &confirm)) { && cmp_verf(&unconf->cl_confirm, &confirm)) {
/* CASE 3: /* CASE 3:
...@@ -924,8 +909,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -924,8 +909,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
if (conf) { if (conf) {
expire_client(conf); expire_client(conf);
} }
clp = unconf;
move_to_confirmed(unconf); move_to_confirmed(unconf);
conf = unconf;
status = nfs_ok; status = nfs_ok;
} }
} else if ((!conf || (conf && !cmp_verf(&conf->cl_confirm, &confirm))) } else if ((!conf || (conf && !cmp_verf(&conf->cl_confirm, &confirm)))
...@@ -944,7 +929,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi ...@@ -944,7 +929,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
} }
out: out:
if (!status) if (!status)
nfsd4_probe_callback(clp); nfsd4_probe_callback(conf);
nfs4_unlock_state(); nfs4_unlock_state();
return status; return status;
} }
......
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