Skip to content

Commit

Permalink
nfsd4: nfsd4_destroy_session must set callback client under the state…
Browse files Browse the repository at this point in the history
… 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: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed May 13, 2010
1 parent d768298 commit ab707e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ void nfsd4_destroy_callback_queue(void)
destroy_workqueue(callback_wq);
}

/* must be called under the state lock */
void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt *new)
{
struct rpc_clnt *old = clp->cl_cb_client;
Expand Down
2 changes: 2 additions & 0 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,10 @@ nfsd4_destroy_session(struct svc_rqst *r,
unhash_session(ses);
spin_unlock(&client_lock);

nfs4_lock_state();
/* wait for callbacks */
nfsd4_set_callback_client(ses->se_client, NULL);
nfs4_unlock_state();
nfsd4_put_session(ses);
status = nfs_ok;
out:
Expand Down

0 comments on commit ab707e1

Please sign in to comment.