btrfs: remove redundant refcount check in btrfs_put_transaction()
PATCH 1/1 btrfs: remove redundant refcount check in btrfs_put_transaction()
From: Xuanqiang Luo <[email protected]>
Eric Dumazet removed the redundant refcount check for sk_refcnt, I noticed a similar issue in btrfs_put_transaction().
refcount_dec_and_test() already checks for a zero refcount and complains, making the preceding WARN_ON redundant.
Cc Eric Dumazet <[email protected]>
Signed-off-by Xuanqiang Luo <[email protected]>
--- fs/btrfs/transaction.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/transaction.c +0 -1
@@ -138,7 +138,6 @@ static const unsigned int btrfs_blocked_trans_types[TRANS_STATE_MAX] = {void btrfs_put_transaction (struct btrfs_transaction *transaction) { -WARN_ON (refcount_read (&transaction->use_count) ==0 );if (refcount_dec_and_test (&transaction->use_count)) {BUG_ON (!list_empty (&transaction->list));WARN_ON (!xa_empty (&transaction->delayed_refs.head_refs));
Signature · 1 line
2.25.1
Quoted 10 lines · On Wed, Oct 15, 2025 at 03:05:21PM +0800, [email protected] wrote:
From: Xuanqiang Luo <[email protected]>
Eric Dumazet removed the redundant refcount check for
sk_refcnt, I noticed a similar issue inbtrfs_put_transaction().
refcount_dec_and_test()already checks for a zero refcount and complains, making the precedingWARN_ONredundant.Cc Eric Dumazet <[email protected]>Signed-off-by Xuanqiang Luo <[email protected]>
Reviewed-by David Sterba <[email protected]>