public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>, linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Mike Snitzer <snitzer@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [PATCH] block: set default max segment size in case of virt_boundary
Date: Mon, 6 May 2024 20:28:19 -0600	[thread overview]
Message-ID: <4792740a-0387-4945-8501-b2c240271ec7@kernel.dk> (raw)
In-Reply-To: <ZjmG0aFl1oU2OeDZ@fedora>

On 5/6/24 7:41 PM, Ming Lei wrote:
> On Wed, Apr 24, 2024 at 09:47:22PM +0800, Ming Lei wrote:
>> For devices with virt_boundary limit, the driver may provide zero max
>> segment size, we have to set it as UINT_MAX at default. Otherwise, it
>> may cause warning in driver when handling sglist.
>>
>> Fix it by setting default max segment size as UINT_MAX.
>>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: Mike Snitzer <snitzer@kernel.org>
>> Fixes: b561ea56a264 ("block: allow device to have both virt_boundary_mask and max segment size")
>> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Closes: https://lore.kernel.org/linux-block/7e38b67c-9372-a42d-41eb-abdce33d3372@linux-m68k.org/
>> Signed-off-by: Ming Lei <ming.lei@redhat.com>
>> ---
>>  block/blk-settings.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/block/blk-settings.c b/block/blk-settings.c
>> index d2731843f2fc..9d6033e01f2e 100644
>> --- a/block/blk-settings.c
>> +++ b/block/blk-settings.c
>> @@ -188,7 +188,10 @@ static int blk_validate_limits(struct queue_limits *lim)
>>  	 * bvec and lower layer bio splitting is supposed to handle the two
>>  	 * correctly.
>>  	 */
>> -	if (!lim->virt_boundary_mask) {
>> +	if (lim->virt_boundary_mask) {
>> +		if (!lim->max_segment_size)
>> +			lim->max_segment_size = UINT_MAX;
>> +	} else {
>>  		/*
>>  		 * The maximum segment size has an odd historic 64k default that
>>  		 * drivers probably should override.  Just like the I/O size we
> 
> Hello Jens,
> 
> Looks this fix is missed, can you make it to v6.9?

Oops yes, thanks for the reminder.

-- 
Jens Axboe


  reply	other threads:[~2024-05-07  2:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 13:47 [PATCH] block: set default max segment size in case of virt_boundary Ming Lei
2024-05-07  1:41 ` Ming Lei
2024-05-07  2:28   ` Jens Axboe [this message]
2024-05-07  2:28 ` 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=4792740a-0387-4945-8501-b2c240271ec7@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=geert+renesas@glider.be \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=snitzer@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox