提交 c98c3d09 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: cleanup the !zoned case in blk_revalidate_disk_zones

blk_revalidate_disk_zones is never called for non-zoned devices.  Just
return early and warn instead of trying to handle this case.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 d9dd7308
......@@ -520,6 +520,9 @@ int blk_revalidate_disk_zones(struct gendisk *disk)
sector_t sector = 0;
int ret = 0;
if (WARN_ON_ONCE(!blk_queue_is_zoned(q)))
return -EIO;
/*
* BIO based queues do not use a scheduler so only q->nr_zones
* needs to be updated so that the sysfs exposed value is correct.
......@@ -535,10 +538,8 @@ int blk_revalidate_disk_zones(struct gendisk *disk)
*/
noio_flag = memalloc_noio_save();
if (!blk_queue_is_zoned(q) || !nr_zones) {
nr_zones = 0;
if (!nr_zones)
goto update;
}
/* Allocate bitmaps */
ret = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册