From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz, nborisov@suse.com
Subject: [PATCH v2 4/5] btrfs: tree-checker: Enhance output for check_csum_item
Date: Fri, 29 Sep 2017 10:37:01 +0900 [thread overview]
Message-ID: <20170929013702.17814-5-quwenruo.btrfs@gmx.com> (raw)
In-Reply-To: <20170929013702.17814-1-quwenruo.btrfs@gmx.com>
Output the bad value and expected good value (or its alignment).
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
---
fs/btrfs/tree-checker.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 94027f4215e9..a5b743763362 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -163,15 +163,21 @@ static int check_csum_item(struct btrfs_root *root, struct extent_buffer *leaf,
u32 csumsize = btrfs_super_csum_size(root->fs_info->super_copy);
if (key->objectid != BTRFS_EXTENT_CSUM_OBJECTID) {
- CORRUPT("invalid objectid for csum item", leaf, root, slot);
+ generic_err(root, leaf, slot,
+ "invalid key objectid for csum item, have %llu expect %llu",
+ key->objectid, BTRFS_EXTENT_CSUM_OBJECTID);
return -EUCLEAN;
}
if (!IS_ALIGNED(key->offset, sectorsize)) {
- CORRUPT("unaligned key offset for csum item", leaf, root, slot);
+ generic_err(root, leaf, slot,
+ "unaligned key offset for csum item, have %llu should be aligned to %u",
+ key->offset, sectorsize);
return -EUCLEAN;
}
if (!IS_ALIGNED(btrfs_item_size_nr(leaf, slot), csumsize)) {
- CORRUPT("unaligned csum item size", leaf, root, slot);
+ generic_err(root, leaf, slot,
+ "unaligned item size for csum item, have %u should be aligned to %u",
+ btrfs_item_size_nr(leaf, slot), csumsize);
return -EUCLEAN;
}
return 0;
--
2.14.2
next prev parent reply other threads:[~2017-09-29 1:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 1:36 [PATCH v2 0/5] Enhance tree block validation checker Qu Wenruo
2017-09-29 1:36 ` [PATCH v2 1/5] btrfs-progs: Move leaf and node validation checker to tree-checker.c Qu Wenruo
2017-09-29 1:36 ` [PATCH v2 2/5] btrfs: tree-checker: Enhance btrfs_check_node output Qu Wenruo
2017-09-29 6:05 ` Nikolay Borisov
2017-09-29 6:08 ` Qu Wenruo
2017-09-29 1:37 ` [PATCH v2 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf Qu Wenruo
2017-09-29 1:37 ` Qu Wenruo [this message]
2017-09-29 1:37 ` [PATCH v2 5/5] btrfs: tree-checker: Enhance output for check_extent_data_item Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170929013702.17814-5-quwenruo.btrfs@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).