diff options
author | NeilBrown <neilb@suse.de> | 2006-04-11 01:55:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:52 -0400 |
commit | 5e8d5c29482dc56de5971ddc99c6e7f69e4d16f6 (patch) | |
tree | fe50096b5742960ff6bcccbb053c1f9b379916c8 /fs | |
parent | 6f54e2d0d3a904e55c9c50b78542072f6c42080e (diff) |
[PATCH] knfsd: nfsd4: fix laundromat shutdown race
We need to make sure the laundromat work doesn't reschedule itself just when
we try to cancel it. Also, we shouldn't be waiting for it to finish running
while holding the state lock, as that's a potential deadlock.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a8c2122a481e..01ff544dc1f5 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3238,8 +3238,6 @@ __nfs4_state_shutdown(void) | |||
3238 | } | 3238 | } |
3239 | 3239 | ||
3240 | cancel_delayed_work(&laundromat_work); | 3240 | cancel_delayed_work(&laundromat_work); |
3241 | flush_workqueue(laundry_wq); | ||
3242 | destroy_workqueue(laundry_wq); | ||
3243 | nfsd4_shutdown_recdir(); | 3241 | nfsd4_shutdown_recdir(); |
3244 | nfs4_init = 0; | 3242 | nfs4_init = 0; |
3245 | } | 3243 | } |
@@ -3247,6 +3245,8 @@ __nfs4_state_shutdown(void) | |||
3247 | void | 3245 | void |
3248 | nfs4_state_shutdown(void) | 3246 | nfs4_state_shutdown(void) |
3249 | { | 3247 | { |
3248 | cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work); | ||
3249 | destroy_workqueue(laundry_wq); | ||
3250 | nfs4_lock_state(); | 3250 | nfs4_lock_state(); |
3251 | nfs4_release_reclaim(); | 3251 | nfs4_release_reclaim(); |
3252 | __nfs4_state_shutdown(); | 3252 | __nfs4_state_shutdown(); |