Skip to content

Commit 373282e

Browse files
jtpittman195axboe
authored andcommitted
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>
1 parent bb351ab commit 373282e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎Documentation/block/null_blk.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0
8888

8989
zoned=[0/1]: Default: 0
9090
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.
9293

9394
zone_size=[MB]: Default: 256
9495
Per zone size when exposed as a zoned block device. Must be a power of two.

‎drivers/block/null_blk.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);
9797
#else
9898
static inline int null_zone_init(struct nullb_device *dev)
9999
{
100+
pr_err("null_blk: CONFIG_BLK_DEV_ZONED not enabled\n");
100101
return -EINVAL;
101102
}
102103
static inline void null_zone_exit(struct nullb_device *dev) {}

0 commit comments

Comments
 (0)