summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>2017-11-03 16:28:05 +0800
committerDavid Sterba <dsterba@suse.com>2017-11-14 15:59:01 +0100
commit29379da543da18f40f0a780bd61823316968607c (patch)
tree0ae93881ac664d1631e82a40c92d85e6ea4e145f /cmds-check.c
parentfaaf70f1cc7ade1d6d5a41a900a3b58cc4bd5f58 (diff)
btrfs-progs: lowmem check: Fix false alert about referencer count mismatch
The normal back reference counting doesn't care about the extent referred by the extent data in the shared leaf. The check_extent_data_backref function need to skip the leaf that owner mismatch with the root_id. Reported-by: Marc MERLIN <marc@merlins.org> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 5750bb72..a93ac2c8 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -12468,7 +12468,8 @@ static int check_extent_data_backref(struct btrfs_fs_info *fs_info,
leaf = path.nodes[0];
slot = path.slots[0];
- if (slot >= btrfs_header_nritems(leaf))
+ if (slot >= btrfs_header_nritems(leaf) ||
+ btrfs_header_owner(leaf) != root_id)
goto next;
btrfs_item_key_to_cpu(leaf, &key, slot);
if (key.objectid != objectid || key.type != BTRFS_EXTENT_DATA_KEY)