summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-11-25 14:19:06 +0800
committerDavid Sterba <dsterba@suse.com>2015-11-26 15:15:38 +0100
commitb08a740d7b797d870cbc3691b1291290d0815998 (patch)
treef4e4c8c715b9384179fd0029f860427453cd8b83 /cmds-check.c
parent73a015578a5f51993645f87ba660372a0ec56997 (diff)
btrfs-progs: fsck: Fix a false alert where extent record has wrong metadata flag
In process_extent_item(), it gives 'metadata' initial value 0, but for non-skinny-metadata case, metadata extent can't be judged just from key type and it forgot that case. This causes a lot of false alert in non-skinny-metadata filesystem. Fix it by set correct metadata value before calling add_extent_rec(). Reported-by: Christoph Anton Mitterer <calestyo@scientia.net> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 6a0b50a3..b45412da 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -5134,6 +5134,10 @@ static int process_extent_item(struct btrfs_root *root,
ei = btrfs_item_ptr(eb, slot, struct btrfs_extent_item);
refs = btrfs_extent_refs(eb, ei);
+ if (btrfs_extent_flags(eb, ei) & BTRFS_EXTENT_FLAG_TREE_BLOCK)
+ metadata = 1;
+ else
+ metadata = 0;
add_extent_rec(extent_cache, NULL, 0, key.objectid, num_bytes,
refs, 0, 0, 0, metadata, 1, num_bytes);