All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Wang Shanker <shankerwangmiao@gmail.com>
Subject: Re: [PATCH RESEND] block: fix discard request merge
Date: Tue, 29 Jun 2021 07:41:29 -0600	[thread overview]
Message-ID: <d3087bbe-a577-1f9b-561d-49d99f4dba62@kernel.dk> (raw)
In-Reply-To: <20210628023312.1903255-1-ming.lei@redhat.com>

On 6/27/21 8:33 PM, Ming Lei wrote:
> ll_new_hw_segment() is reached only in case of single range discard
> merge, and we don't have max discard segment size limit actually, so
> it is wrong to run the following check:
> 
> if (req->nr_phys_segments + nr_phys_segs > blk_rq_get_max_segments(req))
> 
> it may be always false since req->nr_phys_segments is initialized as
> one, and bio's segment count is still 1, blk_rq_get_max_segments(reg)
> is 1 too.
> 
> Fix the issue by not doing the check and bypassing the calculation of
> discard request's nr_phys_segments.
> 
> Based on analysis from Wang Shanker.

Applied, thanks.

-- 
Jens Axboe


      reply	other threads:[~2021-06-29 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  2:33 [PATCH RESEND] block: fix discard request merge Ming Lei
2021-06-29 13:41 ` Jens Axboe [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=d3087bbe-a577-1f9b-561d-49d99f4dba62@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shankerwangmiao@gmail.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 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.