diff options
| author | Slava Pestov <sp@daterainc.com> | 2014-05-20 12:20:28 -0700 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2017-11-26 13:50:34 +0000 |
| commit | cf066ae652c6a1c460248b1a92525cdf35ba3336 (patch) | |
| tree | efe8975a7451daf0285517b988ee8aba3207edb4 | |
| parent | 966bdee67c17bb741838b4e627ae7329e25a8114 (diff) | |
bcache: fix crash on shutdown in passthrough mode
commit a664d0f05a2ec02c8f042db536d84d15d6e19e81 upstream.
We never started the writeback thread in this case, so don't stop it.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| -rw-r--r-- | drivers/md/bcache/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 229743d68031..5fe927ff5b55 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1073,7 +1073,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); |
