diff options
author | Jan Kara <jack@suse.cz> | 2014-04-03 21:46:23 (GMT) |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-05-05 11:36:28 (GMT) |
commit | fa48decc1df0ec789d7bb2ea737f823f649a3cc3 (patch) | |
tree | c535342852b7e464e621de9f2007fbda3d6a682f /mm/hugetlb.c | |
parent | 24239843f9734736d15bc22003a3c2467b7f0fb1 (diff) | |
download | linux-fsl-qoriq-fa48decc1df0ec789d7bb2ea737f823f649a3cc3.tar.xz |
bdi: avoid oops on device removal
commit 5acda9d12dcf1ad0d9a5a2a7c646de3472fa7555 upstream.
After commit 839a8e8660b6 ("writeback: replace custom worker pool
implementation with unbound workqueue") when device is removed while we
are writing to it we crash in bdi_writeback_workfn() ->
set_worker_desc() because bdi->dev is NULL.
This can happen because even though bdi_unregister() cancels all pending
flushing work, nothing really prevents new ones from being queued from
balance_dirty_pages() or other places.
Fix the problem by clearing BDI_registered bit in bdi_unregister() and
checking it before scheduling of any flushing work.
Fixes: 839a8e8660b6777e7fe4e80af1a048aebe2b5977
Reviewed-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Derek Basehore <dbasehore@chromium.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'mm/hugetlb.c')
0 files changed, 0 insertions, 0 deletions