diff mbox series

[f2fs-dev] mkfs.f2fs: use correct endian conversion for writing lpf inode

Message ID 20240903173157.602995-1-daeho43@gmail.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] mkfs.f2fs: use correct endian conversion for writing lpf inode | expand

Commit Message

Daeho Jeong Sept. 3, 2024, 5:31 p.m. UTC
From: Daeho Jeong <daehojeong@google.com>

The conversion between cpu and little endian is incorrect.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 mkfs/f2fs_format.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chao Yu Sept. 5, 2024, 1:14 a.m. UTC | #1
On 2024/9/4 1:31, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> The conversion between cpu and little endian is incorrect.
> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index c9d335a..30d8e19 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -1547,8 +1547,8 @@  static int f2fs_write_lpf_inode(void)
 
 	f2fs_init_inode(sb, raw_node, c.lpf_ino, mkfs_time, 0x41c0);
 
-	raw_node->i.i_pino = le32_to_cpu(sb->root_ino);
-	raw_node->i.i_namelen = le32_to_cpu(strlen(LPF));
+	raw_node->i.i_pino = sb->root_ino;
+	raw_node->i.i_namelen = cpu_to_le32(strlen(LPF));
 	memcpy(raw_node->i.i_name, LPF, strlen(LPF));
 
 	node_blkaddr = alloc_next_free_block(CURSEG_HOT_NODE);