aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-03-07 23:39:01 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-04-22 11:34:02 -0400
commit4b21d0defcc9680da8a694e92d5fe8eb668c2c0b (patch)
tree35684f814bbbc428236e0e542b292521e59f06e3 /fs/nfsd/nfs4state.c
parent2bf23875f55af6038a5d1c164a52cec4c24609ba (diff)
nfsd4: allow 4.0 clients to change callback path
The rfc allows a client to change the callback parameters, but we didn't previously implement it. Teach the callbacks to rerun themselves (by placing themselves on a workqueue) when they recognize that their rpc task has been killed and that the callback connection has changed. Then we can change the callback connection by setting up a new rpc client, modifying the nfs4 client to point at it, waiting for any work in progress to complete, and then shutting down the old client. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 59c9bd4c89e1..4300d9ffe95f 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1312,7 +1312,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1312 cstate->minorversion; 1312 cstate->minorversion;
1313 unconf->cl_cb_conn.cb_prog = cr_ses->callback_prog; 1313 unconf->cl_cb_conn.cb_prog = cr_ses->callback_prog;
1314 unconf->cl_cb_seq_nr = 1; 1314 unconf->cl_cb_seq_nr = 1;
1315 nfsd4_probe_callback(unconf); 1315 nfsd4_probe_callback(unconf, &unconf->cl_cb_conn);
1316 } 1316 }
1317 conf = unconf; 1317 conf = unconf;
1318 } else { 1318 } else {
@@ -1605,9 +1605,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
1605 if (!same_creds(&conf->cl_cred, &unconf->cl_cred)) 1605 if (!same_creds(&conf->cl_cred, &unconf->cl_cred))
1606 status = nfserr_clid_inuse; 1606 status = nfserr_clid_inuse;
1607 else { 1607 else {
1608 /* XXX: We just turn off callbacks until we can handle
1609 * change request correctly. */
1610 atomic_set(&conf->cl_cb_set, 0); 1608 atomic_set(&conf->cl_cb_set, 0);
1609 nfsd4_probe_callback(conf, &unconf->cl_cb_conn);
1611 expire_client(unconf); 1610 expire_client(unconf);
1612 status = nfs_ok; 1611 status = nfs_ok;
1613 1612
@@ -1641,7 +1640,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
1641 } 1640 }
1642 move_to_confirmed(unconf); 1641 move_to_confirmed(unconf);
1643 conf = unconf; 1642 conf = unconf;
1644 nfsd4_probe_callback(conf); 1643 nfsd4_probe_callback(conf, &conf->cl_cb_conn);
1645 status = nfs_ok; 1644 status = nfs_ok;
1646 } 1645 }
1647 } else if ((!conf || (conf && !same_verf(&conf->cl_confirm, &confirm))) 1646 } else if ((!conf || (conf && !same_verf(&conf->cl_confirm, &confirm)))