summary refs log tree commit diff
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-05-18 22:06:41 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-05-31 20:30:01 -0400
commit8f9307119d7fb2f2c04fce27aa492d30e7ac4518 (patch)
tree07fd67a23b0aa364e78c0ba8eeb87d7309c432a8 /fs
parentad72aae5ada1970f423ae7ee0027d0d7eb477597 (diff)
downloadlinux-8f9307119d7fb2f2c04fce27aa492d30e7ac4518.tar.gz
nfsd4: pull out common code from setclientid cases
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c26
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,
 		}
 	}
 	unconf = find_unconfirmed_client_by_str(dname, strhashval);
+	if (unconf)
+		expire_client(unconf);
 	status = nfserr_jukebox;
+	new = create_client(clname, dname, rqstp, &clverifier);
+	if (new == NULL)
+		goto out;
 	if (!conf) {
 		/* 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);
 	} else if (same_verf(&conf->cl_verifier, &clverifier)) {
 		/* 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);
 	} else { /* conf && !same_verf(): */
 		/* 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);
 	}
 	/*