Skip to content

Commit

Permalink
virtio_blk: Don't bother validating blocksize
Browse files Browse the repository at this point in the history
The block queue limits validation does this for us now.

Reviewed-by: Christoph Hellwig <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: John Garry <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
johnpgarry authored and axboe committed Jul 9, 2024
1 parent addc3a6 commit af28172
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,18 +1289,9 @@ static int virtblk_read_limits(struct virtio_blk *vblk,
lim->max_segment_size = max_size;

/* Host can optionally specify the block size of the device */
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&lim->logical_block_size);
if (!err) {
err = blk_validate_block_size(lim->logical_block_size);
if (err) {
dev_err(&vdev->dev,
"virtio_blk: invalid block size: 0x%x\n",
lim->logical_block_size);
return err;
}
}

/* Use topology information if available */
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY,
Expand Down

0 comments on commit af28172

Please sign in to comment.