Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

null_blk: add zoned config support information

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>

authored by

John Pittman and committed by
Jens Axboe
373282e7 bb351aba

+3 -1
+2 -1
Documentation/block/null_blk.txt
··· 88 88 89 89 zoned=[0/1]: Default: 0 90 90 0: Block device is exposed as a random-access block device. 91 - 1: Block device is exposed as a host-managed zoned block device. 91 + 1: Block device is exposed as a host-managed zoned block device. Requires 92 + CONFIG_BLK_DEV_ZONED. 92 93 93 94 zone_size=[MB]: Default: 256 94 95 Per zone size when exposed as a zoned block device. Must be a power of two.
+1
drivers/block/null_blk.h
··· 97 97 #else 98 98 static inline int null_zone_init(struct nullb_device *dev) 99 99 { 100 + pr_err("null_blk: CONFIG_BLK_DEV_ZONED not enabled\n"); 100 101 return -EINVAL; 101 102 } 102 103 static inline void null_zone_exit(struct nullb_device *dev) {}