Skip to content

Commit af28172

Browse files
johnpgarryaxboe
authored andcommitted
virtio_blk: Don't bother validating blocksize
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]>
1 parent addc3a6 commit af28172

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/block/virtio_blk.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,18 +1289,9 @@ static int virtblk_read_limits(struct virtio_blk *vblk,
12891289
lim->max_segment_size = max_size;
12901290

12911291
/* Host can optionally specify the block size of the device */
1292-
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
1292+
virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
12931293
struct virtio_blk_config, blk_size,
12941294
&lim->logical_block_size);
1295-
if (!err) {
1296-
err = blk_validate_block_size(lim->logical_block_size);
1297-
if (err) {
1298-
dev_err(&vdev->dev,
1299-
"virtio_blk: invalid block size: 0x%x\n",
1300-
lim->logical_block_size);
1301-
return err;
1302-
}
1303-
}
13041295

13051296
/* Use topology information if available */
13061297
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY,

0 commit comments

Comments
 (0)