From dce33bbdd61ec2a42bf822ef73598aaa994c0976 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 19 Sep 2023 12:31:42 +0200 Subject: [PATCH] image writer: Correctly handle mtime_nsec on big endiang i_mtime_nsec is 32bit, so use lcfs_u32_to_file, not lcfs_u64_to_file. The later was breaking on big endian arches. Signed-off-by: Alexander Larsson --- libcomposefs/lcfs-writer-erofs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcomposefs/lcfs-writer-erofs.c b/libcomposefs/lcfs-writer-erofs.c index c0617039..8bf66869 100644 --- a/libcomposefs/lcfs-writer-erofs.c +++ b/libcomposefs/lcfs-writer-erofs.c @@ -881,7 +881,7 @@ static int write_erofs_inode_data(struct lcfs_ctx_s *ctx, struct lcfs_node_s *no i.i_uid = lcfs_u32_to_file(node->inode.st_uid); i.i_gid = lcfs_u32_to_file(node->inode.st_gid); i.i_mtime = lcfs_u64_to_file(node->inode.st_mtim_sec); - i.i_mtime_nsec = lcfs_u64_to_file(node->inode.st_mtim_nsec); + i.i_mtime_nsec = lcfs_u32_to_file(node->inode.st_mtim_nsec); if (type == S_IFDIR) { if (node->erofs_n_blocks > 0) {