diff options
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/transaction.c | 2 | ||||
-rw-r--r-- | fs/btrfs/tree-log.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index cd86bffbdc9f..0a5d796c9f7e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -5658,7 +5658,9 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root, | |||
5658 | prev_block = block_start; | 5658 | prev_block = block_start; |
5659 | } | 5659 | } |
5660 | 5660 | ||
5661 | mutex_lock(&extent_root->fs_info->trans_mutex); | ||
5661 | btrfs_record_root_in_trans(found_root); | 5662 | btrfs_record_root_in_trans(found_root); |
5663 | mutex_unlock(&extent_root->fs_info->trans_mutex); | ||
5662 | if (ref_path->owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) { | 5664 | if (ref_path->owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) { |
5663 | /* | 5665 | /* |
5664 | * try to update data extent references while | 5666 | * try to update data extent references while |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 919172de5c9a..4112d53d4f4d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -688,7 +688,9 @@ static noinline int drop_dirty_roots(struct btrfs_root *tree_root, | |||
688 | num_bytes -= btrfs_root_used(&dirty->root->root_item); | 688 | num_bytes -= btrfs_root_used(&dirty->root->root_item); |
689 | bytes_used = btrfs_root_used(&root->root_item); | 689 | bytes_used = btrfs_root_used(&root->root_item); |
690 | if (num_bytes) { | 690 | if (num_bytes) { |
691 | mutex_lock(&root->fs_info->trans_mutex); | ||
691 | btrfs_record_root_in_trans(root); | 692 | btrfs_record_root_in_trans(root); |
693 | mutex_unlock(&root->fs_info->trans_mutex); | ||
692 | btrfs_set_root_used(&root->root_item, | 694 | btrfs_set_root_used(&root->root_item, |
693 | bytes_used - num_bytes); | 695 | bytes_used - num_bytes); |
694 | } | 696 | } |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 20794290256b..9c462fbd60fa 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2832,7 +2832,9 @@ again: | |||
2832 | BUG_ON(!wc.replay_dest); | 2832 | BUG_ON(!wc.replay_dest); |
2833 | 2833 | ||
2834 | wc.replay_dest->log_root = log; | 2834 | wc.replay_dest->log_root = log; |
2835 | mutex_lock(&fs_info->trans_mutex); | ||
2835 | btrfs_record_root_in_trans(wc.replay_dest); | 2836 | btrfs_record_root_in_trans(wc.replay_dest); |
2837 | mutex_unlock(&fs_info->trans_mutex); | ||
2836 | ret = walk_log_tree(trans, log, &wc); | 2838 | ret = walk_log_tree(trans, log, &wc); |
2837 | BUG_ON(ret); | 2839 | BUG_ON(ret); |
2838 | 2840 | ||