mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: John Garry <john.g.garry@oracle.com>,
	axboe@kernel.dk, mst@redhat.com, jasowang@redhat.com,
	xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	pbonzini@redhat.com, stefanha@redhat.com, hare@suse.de,
	kbusch@kernel.org, hch@lst.de
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux.dev
Subject: Re: [PATCH v2 4/5] virtio_blk: Don't bother validating blocksize
Date: Tue, 9 Jul 2024 14:39:20 +0900	[thread overview]
Message-ID: <3a2314b7-ab94-4cf4-80c1-9b3a971c3adb@kernel.org> (raw)
In-Reply-To: <20240708091651.177447-5-john.g.garry@oracle.com>

On 7/8/24 18:16, John Garry wrote:
> 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>
> ---
>  drivers/block/virtio_blk.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index f11b0c3b2625..e3147a611151 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -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);

I really wonder why this does not check that the VIRTIO_BLK_F_BLK_SIZE feature
exists... But that is not the fault of this patch :)

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

> -	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,

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-07-09  5:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  9:16 [PATCH v2 0/5] Validate logical block size in blk_validate_limits() John Garry
2024-07-08  9:16 ` [PATCH v2 1/5] virtio_blk: Fix default logical block size fallback John Garry
2024-07-08  9:16 ` [PATCH v2 2/5] block: Validate logical block size in blk_validate_limits() John Garry
2024-07-09  5:38   ` Damien Le Moal
2024-07-08  9:16 ` [PATCH v2 3/5] null_blk: Don't bother validating blocksize John Garry
2024-07-09  0:12   ` Zhu Yanjun
2024-07-09  5:39   ` Damien Le Moal
2024-07-08  9:16 ` [PATCH v2 4/5] virtio_blk: " John Garry
2024-07-09  5:39   ` Damien Le Moal [this message]
2024-07-08  9:16 ` [PATCH v2 5/5] loop: " John Garry
2024-07-09  5:39   ` Damien Le Moal
2024-07-09  6:01 ` [PATCH v2 0/5] Validate logical block size in blk_validate_limits() Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a2314b7-ab94-4cf4-80c1-9b3a971c3adb@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=eperezma@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®