Re: [PATCH 1/2] btrfs: overwrite a leftover balance item instead of BUG_ON()
From: Siddharth Mishra
Date: Thu Nov 05 2026 - 17:40:31 EST
On Fri, Nov 06, 2026 at 08:39:01AM +1030, Qu Wenruo wrote:
> >
> > Both assumptions can be wrong:
> >
> > - insert_balance_item() inserts the item, then commits the transaction.
> > btrfs_commit_transaction() can fail without aborting the
> > transaction, for example when btrfs_start_dirty_block_groups() fails
> > to allocate a path.
>
> I think no call site can handle a btrfs_commit_transaction() failure
> without transaction abort.
>
> This is a way bigger problem than what you're fixing.
Are you suggesting that the right fix is to make
btrfs_commit_transaction() abort the transaction when
btrfs_start_dirty_block_groups() fails?