Skip to content

Commit

Permalink
nfsd4: nfsd_shutdown_net needs state lock
Browse files Browse the repository at this point in the history
A comment claims the caller should take it, but that's not being done.
Note we don't want it around the cancel_delayed_work_sync since that may
wait on work which holds the client lock.

Reported-by: Benny Halevy <bhalevy@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Oct 30, 2013
1 parent e1a90eb commit e50a26d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -5124,7 +5124,6 @@ nfs4_state_start(void)
return ret;
}

/* should be called with the state lock held */
void
nfs4_state_shutdown_net(struct net *net)
{
Expand All @@ -5135,6 +5134,7 @@ nfs4_state_shutdown_net(struct net *net)
cancel_delayed_work_sync(&nn->laundromat_work);
locks_end_grace(&nn->nfsd4_manager);

nfs4_lock_state();
INIT_LIST_HEAD(&reaplist);
spin_lock(&recall_lock);
list_for_each_safe(pos, next, &nn->del_recall_lru) {
Expand All @@ -5149,6 +5149,7 @@ nfs4_state_shutdown_net(struct net *net)

nfsd4_client_tracking_exit(net);
nfs4_state_destroy_net(net);
nfs4_unlock_state();
}

void
Expand Down

0 comments on commit e50a26d

Please sign in to comment.