From: NeilBrown 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 Signed-off-by: Neil Brown Signed-off-by: Andrew Morton --- fs/nfsd/nfs4state.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN fs/nfsd/nfs4state.c~knfsd-nfsd4-fix-laundromat-shutdown-race fs/nfsd/nfs4state.c --- 25/fs/nfsd/nfs4state.c~knfsd-nfsd4-fix-laundromat-shutdown-race Mon Apr 3 16:08:15 2006 +++ 25-akpm/fs/nfsd/nfs4state.c Mon Apr 3 16:08:15 2006 @@ -3237,8 +3237,6 @@ __nfs4_state_shutdown(void) } cancel_delayed_work(&laundromat_work); - flush_workqueue(laundry_wq); - destroy_workqueue(laundry_wq); nfsd4_shutdown_recdir(); nfs4_init = 0; } @@ -3246,6 +3244,8 @@ __nfs4_state_shutdown(void) void nfs4_state_shutdown(void) { + cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work); + destroy_workqueue(laundry_wq); nfs4_lock_state(); nfs4_release_reclaim(); __nfs4_state_shutdown(); _