From: Qu Wenruo <wqu@suse.com>
To: Hengyu Liang <hengyul@cs.unc.edu>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
linux-btrfs@vger.kernel.org
Cc: Boris Burkov <boris@bur.io>, David Sterba <dsterba@suse.com>,
Chris Mason <mason@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove "rescue=usebackuproot" from "rescue=all" shortcut
Date: Thu, 26 Nov 2026 06:55:14 +1030 [thread overview]
Message-ID: <a9a42697-2d63-4382-b66d-a87950af6289@suse.com> (raw)
In-Reply-To: <20261125171741.3518473-1-hengyul@cs.unc.edu>
在 2026/11/26 03:47, Hengyu Liang 写道:
> Hi Qu,
>
> I found this while comparing the behaviour of different kernel versions.
> I used an LLM to analyse the problem and to draft the patch and this
> message, and I analyzed the result myself.
Then you should also stop waste human time on reading such long word salads.
>
> On 2026/11/17 14:53, Qu Wenruo wrote:
>> Furthermore, one can even argue that this behavior gives a higher chance
>> to mount the fs.
>>
>> Thus counting this as a bug is very weak argument, thus the whole point
>> of your patch may not even stand.
>
> I agree that slot 1 helps when the newest tree root is damaged. But
> "rescue=all" is also what people use to copy data off after an unclean
> shutdown, and there slot 1 can be worse than the newest roots:
>
> 1. The data extents freed by the last committed transaction can already
> hold data of the transaction that did not commit,
That's not a problem, COW makes sure the old data can still be reached.
> while slot 1 still
> points to them, and ignoredatacsums reads them without an error. In
> my test, user A deleted 30 of 60 files in the last transaction, then
> user B wrote and fsynced 60 private (0600) files before a power cut
> (I used a copy of the disk taken at that point).
And fsync is a different behavior. Fsynced data are only in log tree.
No matter if you use the newest slot or not, as long as you ignore the
log tree, those new deletion will not be seen anyway.
> With
> "ro,rescue=all", A's deleted files are back, and 30 of A's files,
> owned by A, contain B's data. Copying the data off with the owners
> kept hands B's data to A. With the newest roots (v7.3, or
> "rescue=all,rescue=usebackuproot_0" now), A sees only the 30 current
> files with A's own data.
>
> 2. On the same disk, "ro,rescue=usebackuproot" fails with "chunk ...
> has missing dev extent" (-EUCLEAN), while the newest roots mount
> without errors. I also have a syzkaller image that mounts with
> ignorebadroots and usebackuproot (plus some unrelated options) on
> the parent of c73eb6f72741 and fails with -EIO on that commit: slot 1
> has a bad checksum,
That's the problem, and users always have the solution to choose which
slot to use.
> the newest roots load. So slot 1 does not always
> give a better chance to mount.
>
> I have two suggestions, but in the end it is your call:
>
> a) "rescue=all" tries the newest roots first and falls back to slot 1
> only when the mount fails with them (similar to the retry Boris
> suggested in his review of your series).
>
> b) Keep slot 1 for "rescue=all", and document in btrfs-progs that an
> older slot can point to reused data blocks, which ignoredatacsums
> then reads without errors.
Nope, not for slot 1 at least.
Data COW ensures it won't write data into an extent just released in the
current transaction.
>
> Thanks,
> Hengyu
prev parent reply other threads:[~2026-11-25 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 3:03 Hengyu Liang
2026-11-17 4:23 ` Qu Wenruo
2026-11-25 17:17 ` Hengyu Liang
2026-11-25 20:25 ` Qu Wenruo [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=a9a42697-2d63-4382-b66d-a87950af6289@suse.com \
--to=wqu@suse.com \
--cc=boris@bur.io \
--cc=dsterba@suse.com \
--cc=hengyul@cs.unc.edu \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@kernel.org \
--cc=quwenruo.btrfs@gmx.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
all inboxes | Powered by JetHome®