diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8da29e8e4de1..11b77a59db62 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -480,6 +480,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, | |||
480 | struct btrfs_transaction *cur_trans = trans->transaction; | 480 | struct btrfs_transaction *cur_trans = trans->transaction; |
481 | struct btrfs_fs_info *info = root->fs_info; | 481 | struct btrfs_fs_info *info = root->fs_info; |
482 | int count = 0; | 482 | int count = 0; |
483 | int err = 0; | ||
483 | 484 | ||
484 | if (--trans->use_count) { | 485 | if (--trans->use_count) { |
485 | trans->block_rsv = trans->orig_rsv; | 486 | trans->block_rsv = trans->orig_rsv; |
@@ -532,18 +533,18 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, | |||
532 | 533 | ||
533 | if (current->journal_info == trans) | 534 | if (current->journal_info == trans) |
534 | current->journal_info = NULL; | 535 | current->journal_info = NULL; |
535 | memset(trans, 0, sizeof(*trans)); | ||
536 | kmem_cache_free(btrfs_trans_handle_cachep, trans); | ||
537 | 536 | ||
538 | if (throttle) | 537 | if (throttle) |
539 | btrfs_run_delayed_iputs(root); | 538 | btrfs_run_delayed_iputs(root); |
540 | 539 | ||
541 | if (trans->aborted || | 540 | if (trans->aborted || |
542 | root->fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) { | 541 | root->fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) { |
543 | return -EIO; | 542 | err = -EIO; |
544 | } | 543 | } |
545 | 544 | ||
546 | return 0; | 545 | memset(trans, 0, sizeof(*trans)); |
546 | kmem_cache_free(btrfs_trans_handle_cachep, trans); | ||
547 | return err; | ||
547 | } | 548 | } |
548 | 549 | ||
549 | int btrfs_end_transaction(struct btrfs_trans_handle *trans, | 550 | int btrfs_end_transaction(struct btrfs_trans_handle *trans, |