OSDN Git Service

null_blk: add zoned config support information
authorJohn Pittman <jpittman@redhat.com>
Fri, 4 Jan 2019 17:06:37 +0000 (12:06 -0500)
committerJens Axboe <axboe@kernel.dk>
Sun, 6 Jan 2019 17:58:27 +0000 (10:58 -0700)
If the kernel is built without CONFIG_BLK_DEV_ZONED, a modprobe
of the null_blk driver with zoned=1 fails with 'Invalid argument'.
This can be confusing to users, prompting a search as to why the
parameter is invalid. To assist in that search, add a bit more
information to the failure, additionally adding to the documentation
that CONFIG_BLK_DEV_ZONED is needed for zoned=1.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: John Pittman <jpittman@redhat.com>
Added null_blk prefix to error message.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Documentation/block/null_blk.txt
drivers/block/null_blk.h

index ea2dafe..4cad102 100644 (file)
@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0
 
 zoned=[0/1]: Default: 0
   0: Block device is exposed as a random-access block device.
-  1: Block device is exposed as a host-managed zoned block device.
+  1: Block device is exposed as a host-managed zoned block device. Requires
+     CONFIG_BLK_DEV_ZONED.
 
 zone_size=[MB]: Default: 256
   Per zone size when exposed as a zoned block device. Must be a power of two.
index b3df279..34b22d6 100644 (file)
@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);
 #else
 static inline int null_zone_init(struct nullb_device *dev)
 {
+       pr_err("null_blk: CONFIG_BLK_DEV_ZONED not enabled\n");
        return -EINVAL;
 }
 static inline void null_zone_exit(struct nullb_device *dev) {}