aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2012-05-15 17:42:08 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-05-31 20:29:45 -0400
commitf07ea10dc8f20dfc215b15b012741fcf9f5aa17b (patch)
tree5edad80d5cd3cc5ff11df5fc6b155fb664e7adc0
parent8dbf28e495337b0c66657e3e278ae0ff175b7140 (diff)
NFSD: SETCLIENTID_CONFIRM returns NFS4ERR_CLID_INUSE too often
According to RFC 3530bis, the only items SETCLIENTID_CONFIRM processing should be concerned with is the clientid, clientid verifier, and principal. The client's IP address is not supposed to be interesting. And, NFS4ERR_CLID_INUSE is meant only for principal mismatches. I triggered this logic with a prototype UCS client -- one that uses the same nfs_client_id4 string for all servers. The client mounted our server via its IPv4, then via its IPv6 address. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 064f61acfe00..91aec738e8fd 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2214,7 +2214,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2214 struct nfsd4_compound_state *cstate, 2214 struct nfsd4_compound_state *cstate,
2215 struct nfsd4_setclientid_confirm *setclientid_confirm) 2215 struct nfsd4_setclientid_confirm *setclientid_confirm)
2216{ 2216{
2217 struct sockaddr *sa = svc_addr(rqstp);
2218 struct nfs4_client *conf, *unconf; 2217 struct nfs4_client *conf, *unconf;
2219 nfs4_verifier confirm = setclientid_confirm->sc_confirm; 2218 nfs4_verifier confirm = setclientid_confirm->sc_confirm;
2220 clientid_t * clid = &setclientid_confirm->sc_clientid; 2219 clientid_t * clid = &setclientid_confirm->sc_clientid;
@@ -2232,17 +2231,12 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2232 conf = find_confirmed_client(clid); 2231 conf = find_confirmed_client(clid);
2233 unconf = find_unconfirmed_client(clid); 2232 unconf = find_unconfirmed_client(clid);
2234 2233
2235 status = nfserr_clid_inuse;
2236 if (conf && !rpc_cmp_addr((struct sockaddr *) &conf->cl_addr, sa))
2237 goto out;
2238 if (unconf && !rpc_cmp_addr((struct sockaddr *) &unconf->cl_addr, sa))
2239 goto out;
2240
2241 /* 2234 /*
2242 * section 14.2.34 of RFC 3530 has a description of 2235 * section 14.2.34 of RFC 3530 has a description of
2243 * SETCLIENTID_CONFIRM request processing consisting 2236 * SETCLIENTID_CONFIRM request processing consisting
2244 * of 4 bullet points, labeled as CASE1 - CASE4 below. 2237 * of 4 bullet points, labeled as CASE1 - CASE4 below.
2245 */ 2238 */
2239 status = nfserr_clid_inuse;
2246 if (conf && unconf && same_verf(&confirm, &unconf->cl_confirm)) { 2240 if (conf && unconf && same_verf(&confirm, &unconf->cl_confirm)) {
2247 /* 2241 /*
2248 * RFC 3530 14.2.34 CASE 1: 2242 * RFC 3530 14.2.34 CASE 1:
@@ -2255,7 +2249,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2255 nfsd4_probe_callback(conf); 2249 nfsd4_probe_callback(conf);
2256 expire_client(unconf); 2250 expire_client(unconf);
2257 status = nfs_ok; 2251 status = nfs_ok;
2258
2259 } 2252 }
2260 } else if (conf && !unconf) { 2253 } else if (conf && !unconf) {
2261 /* 2254 /*
@@ -2297,11 +2290,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
2297 * Client probably hasn't noticed that we rebooted yet. 2290 * Client probably hasn't noticed that we rebooted yet.
2298 */ 2291 */
2299 status = nfserr_stale_clientid; 2292 status = nfserr_stale_clientid;
2300 } else {
2301 /* check that we have hit one of the cases...*/
2302 status = nfserr_clid_inuse;
2303 } 2293 }
2304out: 2294
2305 nfs4_unlock_state(); 2295 nfs4_unlock_state();
2306 return status; 2296 return status;
2307} 2297}