All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Bird <rustybird@net-c.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "Jürgen Groß" <jgross@suse.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Jens Axboe" <axboe@kernel.dk>
Subject: Re: Regression in xen-blkfront regarding sector sizes
Date: Mon, 24 Jun 2024 20:56:47 +0000	[thread overview]
Message-ID: <Znndj9W_bCsFTxkz@mutt> (raw)
In-Reply-To: <20240624143826.GA8973@lst.de>

Christoph Hellwig:
> On Mon, Jun 24, 2024 at 04:29:15PM +0200, Jürgen Groß wrote:
> >> Rusty suspects it's related to
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/block/xen-blkfront.c?id=ba3f67c1163812b5d7ec33705c31edaa30ce6c51,
> >> so I'm cc-ing people mentioned there too.
> >
> > I think the call of blkif_set_queue_limits() in this patch should NOT precede
> > setting of info->sector_size and info->physical_sector_size, as those are
> > needed by blkif_set_queue_limits().
> 
> Yes.  Something like the patch below should fix it.  We could also stop
> passing sector_size and physіcal_sector_size to xlvbd_alloc_gendisk to
> clean things up a bit more.
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index fd7c0ff2139cee..9f3d68044f8882 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1133,6 +1133,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
>  	if (err)
>  		goto out_release_minors;
>  
> +	info->sector_size = sector_size;
> +	info->physical_sector_size = physical_sector_size;
>  	blkif_set_queue_limits(info, &lim);
>  	gd = blk_mq_alloc_disk(&info->tag_set, &lim, info);
>  	if (IS_ERR(gd)) {
> @@ -1159,8 +1161,6 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
>  
>  	info->rq = gd->queue;
>  	info->gd = gd;
> -	info->sector_size = sector_size;
> -	info->physical_sector_size = physical_sector_size;
>  
>  	xlvbd_flush(info);
>  
> 
> 

With this patch applied on top of v6.9.4, I get the correct
logical/physical block sizes and the issue is fixed. Thank you!

Rusty




      reply	other threads:[~2024-06-25  6:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 13:48 Regression in xen-blkfront regarding sector sizes Marek Marczykowski-Górecki
2024-06-24 14:29 ` Jürgen Groß
2024-06-24 14:38   ` Christoph Hellwig
2024-06-24 20:56     ` Rusty Bird [this message]

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=Znndj9W_bCsFTxkz@mutt \
    --to=rustybird@net-c.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jgross@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.