diff options
-rw-r--r-- | fs/btrfs/transaction.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index bc22be9b69b4..cf8706ce85ac 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1450,11 +1450,12 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans, | |||
1450 | 1450 | ||
1451 | spin_lock(&root->fs_info->trans_lock); | 1451 | spin_lock(&root->fs_info->trans_lock); |
1452 | 1452 | ||
1453 | if (list_empty(&cur_trans->list)) { | 1453 | /* |
1454 | spin_unlock(&root->fs_info->trans_lock); | 1454 | * If the transaction is removed from the list, it means this |
1455 | btrfs_end_transaction(trans, root); | 1455 | * transaction has been committed successfully, so it is impossible |
1456 | return; | 1456 | * to call the cleanup function. |
1457 | } | 1457 | */ |
1458 | BUG_ON(list_empty(&cur_trans->list)); | ||
1458 | 1459 | ||
1459 | list_del_init(&cur_trans->list); | 1460 | list_del_init(&cur_trans->list); |
1460 | if (cur_trans == root->fs_info->running_transaction) { | 1461 | if (cur_trans == root->fs_info->running_transaction) { |