diff mbox series

[f2fs-dev,RFC,02/24] dump.f2fs: print checkpoint crc

Message ID 20241029120956.4186731-3-shengyong@oppo.com (mailing list archive)
State New
Headers show
Series f2fs-tools: add testcases | expand

Commit Message

Sheng Yong Oct. 29, 2024, 12:09 p.m. UTC
Signed-off-by: Sheng Yong <shengyong@oppo.com>
---
 fsck/mount.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/fsck/mount.c b/fsck/mount.c
index a189ba73e4bf..a09a974fc810 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -560,6 +560,7 @@  printout:
 void print_ckpt_info(struct f2fs_sb_info *sbi)
 {
 	struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
+	uint32_t crc;
 
 	if (c.layout)
 		goto printout;
@@ -613,6 +614,11 @@  printout:
 	DISP_u64(cp, elapsed_time);
 
 	DISP_u32(cp, sit_nat_version_bitmap[0]);
+	crc = f2fs_checkpoint_chksum(cp);
+	if (c.layout)
+		printf("%-30s %u\n", "crc", crc);
+	else
+		printf("%-30s" "\t\t[0x%8x : %u]\n", "crc", crc, crc);
 	printf("\n\n");
 }