From: Boris Burkov <boris@bur.io>
To: Guanghui Yang <3497809730@qq.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com, mason@kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: clear free space tree state on rebuild failure
Date: Tue, 15 Sep 2026 11:36:10 -0700 [thread overview]
Message-ID: <20260915183610.GA910335@zen.localdomain> (raw)
In-Reply-To: <tencent_F71ECF81628C274CC89FDB3304420C2D1506@qq.com>
On Tue, Sep 15, 2026 at 02:48:45PM +0000, Guanghui Yang wrote:
> btrfs_rebuild_free_space_tree() sets
> BTRFS_FS_CREATING_FREE_SPACE_TREE and
> BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED before rebuilding the free space
> tree. Several error paths return without clearing these flags.
>
> This leaves the flags set on the live filesystem and affects delayed
> reference processing and free-space caching. Clear both flags on all
> free space tree rebuild failure paths.
>
> Fixes: 1d6a4fc85717 ("btrfs: make clear_cache mount option to rebuild FST without disabling it")
I don't think this fixes tag is correct. In that version of the code,
all error paths aborted the transaction at which point the bit being set
or not doesn't really matter, in my opinion.
Unless I am missing something about the importance of clearing the bit
on an aborted transaction, I think the better fixes tag is:
882af9f13e83 ("btrfs: handle free space tree rebuild in multiple transactions")
> Cc: stable@vger.kernel.org # 6.4+
> Assisted-by: Codex:gpt-5
> Tested: make -j$(nproc) fs/btrfs/free-space-tree.o
Is this all the testing you did or did you also run fstests on this
change?
Generally looks like a good fix for start_transaction() errors, though.
Thanks,
Boris
next prev parent reply other threads:[~2026-09-15 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 14:48 Guanghui Yang
2026-09-15 18:36 ` Boris Burkov [this message]
2026-09-15 22:16 ` Qu Wenruo
2026-09-16 2:38 ` [PATCH v2] btrfs: clear free space tree creation " Guanghui Yang
2026-09-16 2:50 ` Qu Wenruo
2026-09-16 5:16 ` [PATCH v3] " Guanghui Yang
2026-09-16 5:28 ` Qu Wenruo
2026-09-16 17:06 ` Boris Burkov
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=20260915183610.GA910335@zen.localdomain \
--to=boris@bur.io \
--cc=3497809730@qq.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@kernel.org \
--cc=stable@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
all inboxes | Powered by JetHome®