]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
virtio_blk: Don't bother validating blocksize
authorJohn Garry <john.g.garry@oracle.com>
Mon, 8 Jul 2024 09:16:50 +0000 (09:16 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Jul 2024 06:00:17 +0000 (00:00 -0600)
The block queue limits validation does this for us now.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240708091651.177447-5-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/virtio_blk.c

index f11b0c3b26256daa03841b8c9c49320d4e884857..e3147a611151034dd343ccf550574eea9ade8953 100644 (file)
@@ -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,