From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH] btrfs-progs: dump-super: Don't verify csum if csum type or size is unknown
Date: Tue, 6 Mar 2018 10:16:51 +0800 [thread overview]
Message-ID: <20180306021651.9364-1-wqu@suse.com> (raw)
Reported-by: Ken Swenson <flat@imo.uto.moe>
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
cmds-inspect-dump-super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c
index 150c2e5aedf4..85bff262ad85 100644
--- a/cmds-inspect-dump-super.c
+++ b/cmds-inspect-dump-super.c
@@ -339,7 +339,9 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
printf("csum\t\t\t0x");
for (i = 0, p = sb->csum; i < csum_size; i++)
printf("%02x", p[i]);
- if (check_csum_sblock(sb, csum_size))
+ if (csum_type != BTRFS_CSUM_TYPE_CRC32 || csum_size != BTRFS_CRC32_SIZE)
+ printf(" [UNKNOWN CSUM TYPE OR SIZE]");
+ else if (check_csum_sblock(sb, csum_size))
printf(" [match]");
else
printf(" [DON'T MATCH]");
--
2.16.2
next reply other threads:[~2018-03-06 2:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 2:16 Qu Wenruo [this message]
2018-03-09 15:50 ` [PATCH] btrfs-progs: dump-super: Don't verify csum if csum type or size is unknown David Sterba
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=20180306021651.9364-1-wqu@suse.com \
--to=wqu@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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).