Commit ab707e15 authored by Benny Halevy's avatar Benny Halevy Committed by J. Bruce Fields

nfsd4: nfsd4_destroy_session must set callback client under the state lock

nfsd4_set_callback_client must be called under the state lock to atomically
set or unset the callback client and shutting down the previous one.
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent d7682988
...@@ -718,6 +718,7 @@ void nfsd4_destroy_callback_queue(void) ...@@ -718,6 +718,7 @@ void nfsd4_destroy_callback_queue(void)
destroy_workqueue(callback_wq); destroy_workqueue(callback_wq);
} }
/* must be called under the state lock */
void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt *new) void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt *new)
{ {
struct rpc_clnt *old = clp->cl_cb_client; struct rpc_clnt *old = clp->cl_cb_client;
......
...@@ -1427,8 +1427,10 @@ nfsd4_destroy_session(struct svc_rqst *r, ...@@ -1427,8 +1427,10 @@ nfsd4_destroy_session(struct svc_rqst *r,
unhash_session(ses); unhash_session(ses);
spin_unlock(&client_lock); spin_unlock(&client_lock);
nfs4_lock_state();
/* wait for callbacks */ /* wait for callbacks */
nfsd4_set_callback_client(ses->se_client, NULL); nfsd4_set_callback_client(ses->se_client, NULL);
nfs4_unlock_state();
nfsd4_put_session(ses); nfsd4_put_session(ses);
status = nfs_ok; status = nfs_ok;
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment