Files
linux/fs
Jan Kara f51667e9c7 bdi: avoid oops on device removal
commit 5acda9d12d upstream.

After commit 839a8e8660 ("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: 839a8e8660

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit bf0972039d)
2014-05-22 21:11:01 +08:00
..
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:33:42 +08:00
2013-05-07 20:16:25 -07:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-03-12 18:55:21 -07:00
2013-11-08 21:34:05 +08:00
2013-07-13 11:42:26 -07:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-13 12:05:31 +09:00
2013-03-23 14:15:31 -07:00
2013-11-08 21:33:42 +08:00
2014-02-13 13:48:00 -08:00
2013-05-07 20:16:25 -07:00
2014-03-23 21:38:09 -07:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2014-03-06 21:30:06 -08:00
2013-04-29 15:40:23 -04:00
2013-10-05 07:13:09 -07:00
2013-11-08 21:34:05 +08:00
2012-10-22 08:50:37 +03:00
2013-11-08 21:34:05 +08:00
2013-02-22 23:31:31 -05:00
2013-02-22 23:31:31 -05:00
2013-11-08 21:34:05 +08:00
2012-12-20 18:46:29 -05:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-05-31 15:16:33 -04:00
2013-02-22 23:31:31 -05:00
2013-07-01 15:45:28 -07:00
2013-11-08 21:34:05 +08:00
2014-02-13 13:47:59 -08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00
2013-11-08 21:34:05 +08:00