From: David Sterba <dsterba@suse.cz>
To: Daniel Vacek <neelx@suse.com>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/4] Transaction aborts in free-space-tree.c
Date: Fri, 2 May 2025 16:31:42 +0200 [thread overview]
Message-ID: <20250502143142.GS9140@suse.cz> (raw)
In-Reply-To: <CAPjX3FfMsjumdvv+BxtknhuGbXROKSioo5KGf-pj0_DafXsYkA@mail.gmail.com>
On Fri, May 02, 2025 at 03:32:52PM +0200, Daniel Vacek wrote:
> On Fri, 2 May 2025 at 15:24, David Sterba <dsterba@suse.cz> wrote:
> >
> > On Fri, May 02, 2025 at 03:15:49PM +0200, Daniel Vacek wrote:
> > > On Wed, 30 Apr 2025 at 18:45, David Sterba <dsterba@suse.com> wrote:
> > > >
> > > > Fix the transaction abort pattern in free-space-tree, it's been there
> > > > from the beginning and not conforming to the pattern we use elsewhere.
> > > >
> > > > David Sterba (4):
> > > > btrfs: move transaction aborts to the error site in
> > > > convert_free_space_to_bitmaps()
> > > > btrfs: move transaction aborts to the error site in
> > > > convert_free_space_to_extents()
> > > > btrfs: move transaction aborts to the error site in
> > > > remove_from_free_space_tree()
> > > > btrfs: move transaction aborts to the error site in
> > > > add_to_free_space_tree()
> > > >
> > > > fs/btrfs/free-space-tree.c | 48 +++++++++++++++++++++++++-------------
> > > > 1 file changed, 32 insertions(+), 16 deletions(-)
> > >
> > > This looks like unnecessary duplicating the code. Shall we rather go
> > > the other way around?
> >
> > What do you mean? There's some smilarity among the functions so yeah
> > the add/remove pairs can be merged to one, but this is orthogonal to the
> > transaction abot calls.
>
> Not that. I meant the code looks simpler without these patches. If
> this is the pattern used elsewhere, maybe we should rather change
> elsewhere to follow free-space-tree.c?
https://btrfs.readthedocs.io/en/latest/dev/Development-notes.html#error-handling-and-transaction-abort
"Please keep all transaction abort exactly at the place where they happen
and do not merge them to one. This pattern should be used everywhere and
is important when debugging because we can pinpoint the line in the code
from the syslog message and do not have to guess which way it got to the
merged call."
next prev parent reply other threads:[~2025-05-02 14:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 16:45 [PATCH 0/4] Transaction aborts in free-space-tree.c David Sterba
2025-04-30 16:45 ` [PATCH 1/4] btrfs: move transaction aborts to the error site in convert_free_space_to_bitmaps() David Sterba
2025-04-30 16:45 ` [PATCH 2/4] btrfs: move transaction aborts to the error site in convert_free_space_to_extents() David Sterba
2025-04-30 16:45 ` [PATCH 3/4] btrfs: move transaction aborts to the error site in remove_from_free_space_tree() David Sterba
2025-04-30 16:45 ` [PATCH 4/4] btrfs: move transaction aborts to the error site in add_to_free_space_tree() David Sterba
2025-05-02 13:15 ` [PATCH 0/4] Transaction aborts in free-space-tree.c Daniel Vacek
2025-05-02 13:24 ` David Sterba
2025-05-02 13:32 ` Daniel Vacek
2025-05-02 14:31 ` David Sterba [this message]
2025-05-02 15:10 ` Daniel Vacek
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=20250502143142.GS9140@suse.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=neelx@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