Skip to content

Commit 0e46064

Browse files
damien-lemoalaxboe
authored andcommitted
virtio_blk: Do not use disk_set_max_open/active_zones()
In virtblk_read_zoned_limits(), setting a zoned block device maximum number of open and active zones using the functions disk_set_max_open_zones() and disk_set_max_active_zones() is incorrect as setting the limits for the request queue is now done atomically when the gendisk is created (with blk_mq_alloc_disk()). The value set by the disk_set_max_open/active_zones() functions will be overwritten. Fix this by setting the maximum number of open and active zones directly in the queue_limits structure passed to virtblk_read_zoned_limits(). Fixes: 8b83725 ("virtio_blk: pass queue_limits to blk_mq_alloc_disk") Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20240301192639.410183-2-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f98364e commit 0e46064

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/virtio_blk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,12 @@ static int virtblk_read_zoned_limits(struct virtio_blk *vblk,
732732

733733
virtio_cread(vdev, struct virtio_blk_config,
734734
zoned.max_open_zones, &v);
735-
disk_set_max_open_zones(vblk->disk, v);
735+
lim->max_open_zones = v;
736736
dev_dbg(&vdev->dev, "max open zones = %u\n", v);
737737

738738
virtio_cread(vdev, struct virtio_blk_config,
739739
zoned.max_active_zones, &v);
740-
disk_set_max_active_zones(vblk->disk, v);
740+
lim->max_active_zones = v;
741741
dev_dbg(&vdev->dev, "max active zones = %u\n", v);
742742

743743
virtio_cread(vdev, struct virtio_blk_config,

0 commit comments

Comments
 (0)