Skip to content
Commit 4ff3d012 authored by John Garry's avatar John Garry Committed by Jens Axboe
Browse files

virtio_blk: Fix default logical block size fallback



If we fail to read a logical block size in virtblk_read_limits() ->
virtio_cread_feature(), then we default to what is in
lim->logical_block_size, but that would be 0.

We can deal with lim->logical_block_size = 0 later in the
blk_mq_alloc_disk(), but the code in virtblk_read_limits() needs a proper
default, so give a default of SECTOR_SIZE.

Fixes: 27e32cd2 ("block: pass a queue_limits argument to blk_mq_alloc_disk")
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240708091651.177447-2-john.g.garry@oracle.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6b43537f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment