bcache: prevent crash on changing writeback_running
authorStefan Bader <stefan.bader@canonical.com>
Mon, 30 Nov 2015 02:44:49 +0000 (18:44 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 31 Dec 2015 03:23:14 +0000 (20:23 -0700)
commit8d16ce540c94c9d366eb36fc91b7154d92d6397b
tree0fae348076b0dcd745a2ee2cadaba965bd0587e4
parentd7076f21629f8f329bca4a44dc408d94670f49e2
bcache: prevent crash on changing writeback_running

Added a safeguard in the shutdown case. At least while not being
attached it is also possible to trigger a kernel bug by writing into
writeback_running. This change  adds the same check before trying to
wake up the thread for that case.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/md/bcache/writeback.h