Re: [PATCH v3 02/10] block: Introduce REQ_OP_ZONE_APPEND
From: Keith Busch <kbusch@kernel.org>
Date: 2020-03-31 15:23:26
Also in:
linux-fsdevel, linux-scsi
From: Keith Busch <kbusch@kernel.org>
Date: 2020-03-31 15:23:26
Also in:
linux-fsdevel, linux-scsi
On Sat, Mar 28, 2020 at 01:50:04AM +0900, Johannes Thumshirn wrote:
--- a/block/blk-zoned.c +++ b/block/blk-zoned.c@@ -455,6 +455,15 @@ int blk_revalidate_disk_zones(struct gendisk *disk) blk_revalidate_zone_cb, &args); memalloc_noio_restore(noio_flag); + if (ret == 0 && + (queue_max_zone_append_sectors(q) > queue_max_hw_sectors(q) || + queue_max_zone_append_sectors(q) > q->limits.chunk_sectors)) { + pr_warn("%s: invalid max_zone_append_bytes value: %u\n", + disk->disk_name, queue_max_zone_append_sectors(q) << 9); + ret = -EINVAL; + goto out; + } +
The generic block layer doesn't set chunk_sectors until after this, so unless the driver happened to set it earlier, this check would fail. We don't want to rely on the driver doing this, so I'll fix it up for the next version.