提交 5e8d5c29 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[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: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6f54e2d0
......@@ -3238,8 +3238,6 @@ __nfs4_state_shutdown(void)
}
cancel_delayed_work(&laundromat_work);
flush_workqueue(laundry_wq);
destroy_workqueue(laundry_wq);
nfsd4_shutdown_recdir();
nfs4_init = 0;
}
......@@ -3247,6 +3245,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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册