summaryrefslogtreecommitdiff
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorSlava Pestov <sp@daterainc.com>2014-05-20 19:20:28 (GMT)
committerKent Overstreet <kmo@daterainc.com>2014-08-04 22:23:03 (GMT)
commita664d0f05a2ec02c8f042db536d84d15d6e19e81 (patch)
treea3edc9ae887c29918be9e17080511bde24c74c89 /drivers/md/bcache
parente5112201c1285841f8b565ece5d6ae7e0d7947a2 (diff)
downloadlinux-a664d0f05a2ec02c8f042db536d84d15d6e19e81.tar.xz
bcache: fix crash on shutdown in passthrough mode
We never started the writeback thread in this case, so don't stop it.
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 09573c2..6ceaec3 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1071,7 +1071,8 @@ static void cached_dev_free(struct closure *cl)
struct cached_dev *dc = container_of(cl, struct cached_dev, disk.cl);
cancel_delayed_work_sync(&dc->writeback_rate_update);
- kthread_stop(dc->writeback_thread);
+ if (!IS_ERR_OR_NULL(dc->writeback_thread))
+ kthread_stop(dc->writeback_thread);
mutex_lock(&bch_register_lock);