Set dc->writebacking_running only after writeback kthread created. And check value of writeback_running set via sysfs against if writeback kthread already created or not. Shenghui Wang (2): bcache: do not mark writeback_running until backing dev attached to cache_set bcache: cannot set writeback_running via sysfs if no writeback kthread created drivers/md/bcache/sysfs.c | 21 +++++++++++++++++++-- drivers/md/bcache/writeback.c | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) -- 2.18.0