diff mbox

[1/2] btrfs-progs: dump-tree: Fix duplicated output when using -t option

Message ID 20170314052828.27155-1-quwenruo@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Qu Wenruo March 14, 2017, 5:28 a.m. UTC
When using -t option to output trees not in root tree (chunk/root/log
root), then we output the tree twice.

Fix it

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 cmds-inspect-dump-tree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c
index 6c6c0e5c..2c6bec7f 100644
--- a/cmds-inspect-dump-tree.c
+++ b/cmds-inspect-dump-tree.c
@@ -371,21 +371,21 @@  again:
 	if (tree_id && tree_id == BTRFS_ROOT_TREE_OBJECTID) {
 		if (!info->tree_root->node) {
 			error("cannot print root tree, invalid pointer");
-			goto no_node;
+			goto close_root;
 		}
 		printf("root tree\n");
 		btrfs_print_tree(info->tree_root, info->tree_root->node, 1);
-		goto no_node;
+		goto close_root;
 	}
 
 	if (tree_id && tree_id == BTRFS_CHUNK_TREE_OBJECTID) {
 		if (!info->chunk_root->node) {
 			error("cannot print chunk tree, invalid pointer");
-			goto no_node;
+			goto close_root;
 		}
 		printf("chunk tree\n");
 		btrfs_print_tree(info->chunk_root, info->chunk_root->node, 1);
-		goto no_node;
+		goto close_root;
 	}
 
 	key.offset = 0;