Message ID | 20180128015625.128497-9-colyli@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 4204d75aee7b..97e3bb8e1aee 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1478,6 +1478,14 @@ static void __cache_set_unregister(struct closure *cl) dc = container_of(c->devices[i], struct cached_dev, disk); bch_cached_dev_detach(dc); + /* + * If we come here by too many I/O errors, + * bcache device should be stopped too, to + * keep data consistency on cache and + * backing devices. + */ + if (test_bit(CACHE_SET_IO_DISABLE, &c->flags)) + bcache_device_stop(c->devices[i]); } else { bcache_device_stop(c->devices[i]); }