aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 203d9a5a4030..aff579df5f47 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6616,8 +6616,14 @@ loop:
6616 loop++; 6616 loop++;
6617 if (loop == LOOP_ALLOC_CHUNK) { 6617 if (loop == LOOP_ALLOC_CHUNK) {
6618 struct btrfs_trans_handle *trans; 6618 struct btrfs_trans_handle *trans;
6619 int exist = 0;
6620
6621 trans = current->journal_info;
6622 if (trans)
6623 exist = 1;
6624 else
6625 trans = btrfs_join_transaction(root);
6619 6626
6620 trans = btrfs_join_transaction(root);
6621 if (IS_ERR(trans)) { 6627 if (IS_ERR(trans)) {
6622 ret = PTR_ERR(trans); 6628 ret = PTR_ERR(trans);
6623 goto out; 6629 goto out;
@@ -6634,7 +6640,8 @@ loop:
6634 root, ret); 6640 root, ret);
6635 else 6641 else
6636 ret = 0; 6642 ret = 0;
6637 btrfs_end_transaction(trans, root); 6643 if (!exist)
6644 btrfs_end_transaction(trans, root);
6638 if (ret) 6645 if (ret)
6639 goto out; 6646 goto out;
6640 } 6647 }