[PATCH 1/3] bcache: fix crash on shutdown in passthrough mode

Stefan Bader stefan.bader at canonical.com
Thu Aug 21 12:19:25 UTC 2014


From: Slava Pestov <sp at daterainc.com>

We never started the writeback thread in this case, so don't stop it.

BugLink: http://bugs.launchpad.net/bugs/1357295

(cherry-picked from commit a664d0f05a2ec02c8f042db536d84d15d6e19e81 upstream)

Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
---
 drivers/md/bcache/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index c57bfa0..b2324ba 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1052,7 +1052,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);
 
-- 
1.9.1





More information about the kernel-team mailing list