btrfs-progs: disk-io: Support commit transaction on chunk tree
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 7 Jul 2015 08:15:22 +0000 (16:15 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 10 Jul 2015 12:29:09 +0000 (14:29 +0200)
As chunk tree is only stored in super block, chunk tree commit doesn't
need to go through tree root update.
Or a BUG_ON will be triggered.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
disk-io.c

index 6a53843..fdcfd6d 100644 (file)
--- a/disk-io.c
+++ b/disk-io.c
@@ -571,6 +571,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
                goto commit_tree;
        if (root == root->fs_info->tree_root)
                goto commit_tree;
+       if (root == root->fs_info->chunk_root)
+               goto commit_tree;
 
        free_extent_buffer(root->commit_root);
        root->commit_root = NULL;