mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
nfsd4: pull out common code from setclientid cases
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
ad72aae5ad
commit
8f9307119d
@ -2189,36 +2189,20 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unconf = find_unconfirmed_client_by_str(dname, strhashval);
|
unconf = find_unconfirmed_client_by_str(dname, strhashval);
|
||||||
|
if (unconf)
|
||||||
|
expire_client(unconf);
|
||||||
status = nfserr_jukebox;
|
status = nfserr_jukebox;
|
||||||
|
new = create_client(clname, dname, rqstp, &clverifier);
|
||||||
|
if (new == NULL)
|
||||||
|
goto out;
|
||||||
if (!conf) {
|
if (!conf) {
|
||||||
/* case 4: placed first, because it's the normal case */
|
/* case 4: placed first, because it's the normal case */
|
||||||
if (unconf)
|
|
||||||
expire_client(unconf);
|
|
||||||
new = create_client(clname, dname, rqstp, &clverifier);
|
|
||||||
if (new == NULL)
|
|
||||||
goto out;
|
|
||||||
gen_clid(new);
|
gen_clid(new);
|
||||||
} else if (same_verf(&conf->cl_verifier, &clverifier)) {
|
} else if (same_verf(&conf->cl_verifier, &clverifier)) {
|
||||||
/* case 1: probable callback update */
|
/* case 1: probable callback update */
|
||||||
if (unconf) {
|
|
||||||
/* Note this is removing unconfirmed {*x***},
|
|
||||||
* which is stronger than RFC recommended {vxc**}.
|
|
||||||
* This has the advantage that there is at most
|
|
||||||
* one {*x***} in either list at any time.
|
|
||||||
*/
|
|
||||||
expire_client(unconf);
|
|
||||||
}
|
|
||||||
new = create_client(clname, dname, rqstp, &clverifier);
|
|
||||||
if (new == NULL)
|
|
||||||
goto out;
|
|
||||||
copy_clid(new, conf);
|
copy_clid(new, conf);
|
||||||
} else { /* conf && !same_verf(): */
|
} else { /* conf && !same_verf(): */
|
||||||
/* cases 2, 3: probable client reboot: */
|
/* cases 2, 3: probable client reboot: */
|
||||||
if (unconf)
|
|
||||||
expire_client(unconf);
|
|
||||||
new = create_client(clname, dname, rqstp, &clverifier);
|
|
||||||
if (new == NULL)
|
|
||||||
goto out;
|
|
||||||
gen_clid(new);
|
gen_clid(new);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user