Skip to contentSkip to conversation

btrfs-progs: dump-super: Don't verify csum if csum type or size is unknown

PATCH Applied Qu Wenruo 2 participants 2 messages Mar 6, 2018 – Mar 9, 2018 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: dump-super: Don't verify csum if csum type or size is unknown

---
 cmds-inspect-dump-super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmds-inspect-dump-super.c +3 -1
index 150c2e5aedf4..85bff262ad85 100644
@@ -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]");
Signature · 1 line
2.16.2