public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] block: bio: Trim bio to sensible size in bio_trim()
Date: Mon, 31 Aug 2020 06:26:50 +0000	[thread overview]
Message-ID: <4772af7044754f96a7e0be4ef93fa2bf@huawei.com> (raw)

Jens Axboe <axboe@kernel.dk> wrote:
>On 8/29/20 3:37 AM, Miaohe Lin wrote:
>> Trim bio to sensible size in bio_trim() or something bad may happen.
>
>This really needs a LOT more detail. What is "something bad"? How does this condition trigger to begin with?
>

Many thanks for your reply.

I do this mainly by code review, so I didn't find the condition trigger to begin with. But I think it's better
to do such a check as this is a external Interface. Also If bio_trim() set bio->bi_iter.bi_size to a value larger than the origin one,
we may access the bio_vec past the last one of bio->bi_io_vec in for_each_bvec macro.

>--
>Jens Axboe
>

             reply	other threads:[~2020-08-31  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31  6:26 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-29  9:37 [PATCH] block: bio: Trim bio to sensible size in bio_trim() Miaohe Lin
2020-08-29 14:32 ` 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=4772af7044754f96a7e0be4ef93fa2bf@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.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