소스 검색

bcache: fix crash on shutdown in passthrough mode

We never started the writeback thread in this case, so don't stop it.
Slava Pestov 11 년 전
부모
커밋
a664d0f05a
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      drivers/md/bcache/super.c

+ 2 - 1
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);