diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-05-18 22:06:41 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:30:01 -0400 |
commit | 8f9307119d7fb2f2c04fce27aa492d30e7ac4518 (patch) | |
tree | 07fd67a23b0aa364e78c0ba8eeb87d7309c432a8 /fs/nfsd/nfs4state.c | |
parent | ad72aae5ada1970f423ae7ee0027d0d7eb477597 (diff) |
nfsd4: pull out common code from setclientid cases
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index f62ab7624b1f..1fe06ebf192f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2189,36 +2189,20 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
2189 | } | 2189 | } |
2190 | } | 2190 | } |
2191 | unconf = find_unconfirmed_client_by_str(dname, strhashval); | 2191 | unconf = find_unconfirmed_client_by_str(dname, strhashval); |
2192 | if (unconf) | ||
2193 | expire_client(unconf); | ||
2192 | status = nfserr_jukebox; | 2194 | status = nfserr_jukebox; |
2195 | new = create_client(clname, dname, rqstp, &clverifier); | ||
2196 | if (new == NULL) | ||
2197 | goto out; | ||
2193 | if (!conf) { | 2198 | if (!conf) { |
2194 | /* case 4: placed first, because it's the normal case */ | 2199 | /* case 4: placed first, because it's the normal case */ |
2195 | if (unconf) | ||
2196 | expire_client(unconf); | ||
2197 | new = create_client(clname, dname, rqstp, &clverifier); | ||
2198 | if (new == NULL) | ||
2199 | goto out; | ||
2200 | gen_clid(new); | 2200 | gen_clid(new); |
2201 | } else if (same_verf(&conf->cl_verifier, &clverifier)) { | 2201 | } else if (same_verf(&conf->cl_verifier, &clverifier)) { |
2202 | /* case 1: probable callback update */ | 2202 | /* case 1: probable callback update */ |
2203 | if (unconf) { | ||
2204 | /* Note this is removing unconfirmed {*x***}, | ||
2205 | * which is stronger than RFC recommended {vxc**}. | ||
2206 | * This has the advantage that there is at most | ||
2207 | * one {*x***} in either list at any time. | ||
2208 | */ | ||
2209 | expire_client(unconf); | ||
2210 | } | ||
2211 | new = create_client(clname, dname, rqstp, &clverifier); | ||
2212 | if (new == NULL) | ||
2213 | goto out; | ||
2214 | copy_clid(new, conf); | 2203 | copy_clid(new, conf); |
2215 | } else { /* conf && !same_verf(): */ | 2204 | } else { /* conf && !same_verf(): */ |
2216 | /* cases 2, 3: probable client reboot: */ | 2205 | /* cases 2, 3: probable client reboot: */ |
2217 | if (unconf) | ||
2218 | expire_client(unconf); | ||
2219 | new = create_client(clname, dname, rqstp, &clverifier); | ||
2220 | if (new == NULL) | ||
2221 | goto out; | ||
2222 | gen_clid(new); | 2206 | gen_clid(new); |
2223 | } | 2207 | } |
2224 | /* | 2208 | /* |