summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>2018-02-28 18:13:21 +0800
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:15:53 +0200
commit634e73e9d3464e7a333eda10ef3e5652d8d32293 (patch)
treef93749ddbf4fe5c36339a24df9380f5d72249093 /check
parent14bf2b546d1cdc4ea20304d2fb7d67d75f8a2c55 (diff)
btrfs-progs: check/lowmem: Fix the incorrect error message of check_extent_data_item
Instead of the disk_bytenr and disk_num_bytes of the extent_item which the file extent references, we should output the objectid and offset of the file extent. And the leaf may be shared by the file trees, we should print the objectid of the root and the owner of the leaf. Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'check')
-rw-r--r--check/mode-lowmem.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 62bcf3d2..f37b1b2c 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -2631,9 +2631,9 @@ static int check_extent_data_item(struct btrfs_root *root,
if (!(extent_flags & BTRFS_EXTENT_FLAG_DATA)) {
error(
- "extent[%llu %llu] backref type mismatch, wanted bit: %llx",
- disk_bytenr, disk_num_bytes,
- BTRFS_EXTENT_FLAG_DATA);
+"file extent[%llu %llu] root %llu owner %llu backref type mismatch, wanted bit: %llx",
+ fi_key.objectid, fi_key.offset, root->objectid, owner,
+ BTRFS_EXTENT_FLAG_DATA);
err |= BACKREF_MISMATCH;
}
@@ -2722,8 +2722,9 @@ out:
err |= BACKREF_MISSING;
btrfs_release_path(&path);
if (err & BACKREF_MISSING) {
- error("data extent[%llu %llu] backref lost",
- disk_bytenr, disk_num_bytes);
+ error(
+ "file extent[%llu %llu] root %llu owner %llu backref lost",
+ fi_key.objectid, fi_key.offset, root->objectid, owner);
}
return err;
}