Skip to content

Commit bc30965

Browse files
Xuanqiang Luokdave
authored andcommitted
btrfs: remove redundant refcount check in btrfs_put_transaction()
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. This is a leftover from the atomic_t times. Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 0c9091a commit bc30965

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/btrfs/transaction.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ static const unsigned int btrfs_blocked_trans_types[TRANS_STATE_MAX] = {
138138

139139
void btrfs_put_transaction(struct btrfs_transaction *transaction)
140140
{
141-
WARN_ON(refcount_read(&transaction->use_count) == 0);
142141
if (refcount_dec_and_test(&transaction->use_count)) {
143142
BUG_ON(!list_empty(&transaction->list));
144143
WARN_ON(!xa_empty(&transaction->delayed_refs.head_refs));

0 commit comments

Comments
 (0)