diff options
-rw-r--r-- | fs/btrfs/transaction.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2e177d7f4bb9..4e83457ea253 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -543,13 +543,13 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, | |||
543 | btrfs_free_log(trans, root); | 543 | btrfs_free_log(trans, root); |
544 | btrfs_update_reloc_root(trans, root); | 544 | btrfs_update_reloc_root(trans, root); |
545 | 545 | ||
546 | if (root->commit_root == root->node) | 546 | if (root->commit_root != root->node) { |
547 | continue; | 547 | free_extent_buffer(root->commit_root); |
548 | 548 | root->commit_root = btrfs_root_node(root); | |
549 | free_extent_buffer(root->commit_root); | 549 | btrfs_set_root_node(&root->root_item, |
550 | root->commit_root = btrfs_root_node(root); | 550 | root->node); |
551 | } | ||
551 | 552 | ||
552 | btrfs_set_root_node(&root->root_item, root->node); | ||
553 | err = btrfs_update_root(trans, fs_info->tree_root, | 553 | err = btrfs_update_root(trans, fs_info->tree_root, |
554 | &root->root_key, | 554 | &root->root_key, |
555 | &root->root_item); | 555 | &root->root_item); |