From 34c5de39d3297777993e0ceab115de69f8087a2f Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 16 May 2023 19:28:54 +0800 Subject: [PATCH] btrfs-progs: dump-tree: skip tree-checker when dumpping tree blocks Since commit c8593f65cbf3 ("btrfs-progs: sync tree-checker.[ch] from kernel"), btrfs-progs can do the kernel level tree block checks, which is not really sutiable for dump-tree. Under a lot of cases, we're using dump-tree tool to debug to collect the details from end users. If it's a bitflip causing a rejection, we would be unable to determine the cause. So this patch would add OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS for dump-tree. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- cmds/inspect-dump-tree.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index 7c524b04d6..bfc0fff148 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -342,8 +342,12 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, * Use NO_BLOCK_GROUPS here could also speedup open_ctree() and allow us * to inspect fs with corrupted extent tree blocks, and show as many good * tree blocks as possible. + * + * And we want to avoid tree-checker, which can rejects the target tree + * block completely, while we may be debugging the problem. */ - open_ctree_flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS; + open_ctree_flags = OPEN_CTREE_PARTIAL | OPEN_CTREE_NO_BLOCK_GROUPS | + OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS; cache_tree_init(&block_root); optind = 0; while (1) {