bcache: reject writeback cache mode for zoned backing device
Currently we don't support writeback mode for zoned device as backing
device. So reject it by sysfs interface.
This rejection will be removed after the writeback cache mode support
for zoned device gets done.
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 0dadec5..a9ae389 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -359,6 +359,11 @@ STORE(__cached_dev)
if (v < 0)
return v;
+ if ((unsigned int) v == CACHE_MODE_WRITEBACK) {
+ pr_err("writeback mode is not supported for zoned backing device.\n");
+ return -ENOTSUPP;
+ }
+
if ((unsigned int) v != BDEV_CACHE_MODE(&dc->sb)) {
SET_BDEV_CACHE_MODE(&dc->sb, v);
bch_write_bdev_super(dc, NULL);