public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Cc: Rongrong <i@rong.moe>
Subject: Re: [PATCH] btrfs: scrub: avoid use-after-free when chunk end is not 64K aligned
Date: Tue, 16 Jan 2024 09:20:58 +1030	[thread overview]
Message-ID: <de82a8aa-7b51-4aa1-9cd6-a2f749a6e941@gmx.com> (raw)
In-Reply-To: <12744dd0-a56e-487e-b27d-4ad66498d7e5@wdc.com>



On 2024/1/15 22:39, Johannes Thumshirn wrote:
[...]
>
>> - Make sure scrub_submit_initial_read() only to read the chunk range
>>     This is done by calculating the real number of sectors we need to
>>     read, and add sector-by-sector to the bio.
>
> Why can't you do it the same way the RST version does it by checking the
> extent_sector_bitmap and then add sector-by-sector from it?

Sure, we can, although the whole new scrub code is before RST, and at
that time, the whole 64K read behavior is considered as a better option,
as it reduces the IOPS for a fragmented stripe.

And initially to make the code much simpler, but it turns out that the
"simpler" code is also less robust, requiring very strict never-be-split
condition, and finally leading to the bug.

Thanks,
Qu

  reply	other threads:[~2024-01-15 22:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 10:19 [PATCH] btrfs: scrub: avoid use-after-free when chunk end is not 64K aligned Qu Wenruo
2024-01-15 12:09 ` Johannes Thumshirn
2024-01-15 22:50   ` Qu Wenruo [this message]
2024-01-16 18:28     ` David Sterba
2024-01-16 20:06       ` Qu Wenruo
2024-01-17  0:55         ` David Sterba
2024-01-17  2:23           ` Qu Wenruo

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=de82a8aa-7b51-4aa1-9cd6-a2f749a6e941@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=i@rong.moe \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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