Commit 50c7b948 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: minor consolidation of mach_cred handling code

Minor cleanup, no change in functionality.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 50043859
...@@ -2375,10 +2375,17 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2375,10 +2375,17 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
if (exid->flags & ~EXCHGID4_FLAG_MASK_A) if (exid->flags & ~EXCHGID4_FLAG_MASK_A)
return nfserr_inval; return nfserr_inval;
new = create_client(exid->clname, rqstp, &verf);
if (new == NULL)
return nfserr_jukebox;
switch (exid->spa_how) { switch (exid->spa_how) {
case SP4_MACH_CRED: case SP4_MACH_CRED:
if (!svc_rqst_integrity_protected(rqstp)) if (!svc_rqst_integrity_protected(rqstp)) {
return nfserr_inval; status = nfserr_inval;
goto out_nolock;
}
new->cl_mach_cred = true;
case SP4_NONE: case SP4_NONE:
break; break;
default: /* checked by xdr code */ default: /* checked by xdr code */
...@@ -2387,10 +2394,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2387,10 +2394,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
return nfserr_encr_alg_unsupp; return nfserr_encr_alg_unsupp;
} }
new = create_client(exid->clname, rqstp, &verf);
if (new == NULL)
return nfserr_jukebox;
/* Cases below refer to rfc 5661 section 18.35.4: */ /* Cases below refer to rfc 5661 section 18.35.4: */
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
conf = find_confirmed_client_by_name(&exid->clname, nn); conf = find_confirmed_client_by_name(&exid->clname, nn);
...@@ -2452,7 +2455,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2452,7 +2455,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
goto out; goto out;
} }
new->cl_minorversion = cstate->minorversion; new->cl_minorversion = cstate->minorversion;
new->cl_mach_cred = (exid->spa_how == SP4_MACH_CRED);
gen_clid(new, nn); gen_clid(new, nn);
add_to_unconfirmed(new); add_to_unconfirmed(new);
...@@ -2470,6 +2472,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2470,6 +2472,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
out: out:
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
out_nolock:
if (new) if (new)
expire_client(new); expire_client(new);
if (unconf) if (unconf)
......
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