diff mbox series

[f2fs-dev,1/3] dump.f2fs: support to dump hex of filename in dump_dirent()

Message ID 20250331030034.481423-1-chao@kernel.org (mailing list archive)
State New
Headers show
Series [f2fs-dev,1/3] dump.f2fs: support to dump hex of filename in dump_dirent() | expand

Commit Message

Chao Yu March 31, 2025, 3 a.m. UTC
dump.f2fs -b $blkaddr -d 3 /dev/vda

[dump_dirent: 991] bitmap pos[0x2] name[❤️] len[0x6] hash[0x19dd7132] ino[0x5] type[0x1]
[dump_dirent: 998] name(hex)[0xe2 0x9d 0xa4 0xef 0xb8 0x8f 0x0]

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fsck/dump.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fsck/dump.c b/fsck/dump.c
index dc3c199..66d6c79 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -937,7 +937,7 @@  static void dump_dirent(u32 blk_addr, int is_inline, int enc_name)
 {
 	struct f2fs_dentry_ptr d;
 	void *inline_dentry, *blk;
-	int ret, i = 0;
+	int ret, i = 0, j;
 
 	blk = calloc(F2FS_BLKSIZE, 1);
 	ASSERT(blk);
@@ -992,6 +992,11 @@  static void dump_dirent(u32 blk_addr, int is_inline, int enc_name)
 				le32_to_cpu(de->ino),
 				de->file_type);
 
+		DBG(1, "%s", "name(hex)[");
+		for (j = 0; j < F2FS_NAME_LEN && en[j]; j++)
+			MSG(1, "0x%x ", (unsigned char)en[j]);
+		MSG(1, "0x%x]\n", (unsigned char)en[j]);
+
 		i += GET_DENTRY_SLOTS(name_len);
 	}