Skip to content

Commit d385f15

Browse files
committed
erofs: add __packed annotation to union(__le16..)
I'm unsure why they aren't 2 bytes in size only in arm-linux-gnueabi. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Fixes: 61ba89b ("erofs: add 48-bit block addressing on-disk support") Fixes: efb2aef ("erofs: add encoded extent on-disk definition") Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1595f15 commit d385f15

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/erofs/erofs_fs.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct erofs_super_block {
5656
union {
5757
__le16 rootnid_2b; /* nid of root directory */
5858
__le16 blocks_hi; /* (48BIT on) blocks count MSB */
59-
} rb;
59+
} __packed rb;
6060
__le64 inos; /* total valid ino # (== f_files - f_favail) */
6161
__le64 epoch; /* base seconds used for compact inodes */
6262
__le32 fixed_nsec; /* fixed nanoseconds for compact inodes */
@@ -148,7 +148,7 @@ union erofs_inode_i_nb {
148148
__le16 nlink; /* if EROFS_I_NLINK_1_BIT is unset */
149149
__le16 blocks_hi; /* total blocks count MSB */
150150
__le16 startblk_hi; /* starting block number MSB */
151-
};
151+
} __packed;
152152

153153
/* 32-byte reduced form of an ondisk inode */
154154
struct erofs_inode_compact {
@@ -369,9 +369,9 @@ struct z_erofs_map_header {
369369
* bit 7 : pack the whole file into packed inode
370370
*/
371371
__u8 h_clusterbits;
372-
};
372+
} __packed;
373373
__le16 h_extents_hi; /* extent count MSB */
374-
};
374+
} __packed;
375375
};
376376

377377
enum {

0 commit comments

Comments
 (0)