bcachefs: fix warning about alignment of bversion in bkey
PATCH 1/1 bcachefs: fix warning about alignment of bversion in bkey
This resolves a warning seen on big endian architectures where struct bversion is misaligned when embedded within struct bkey, because bversion has an explicit "__aligned(4)" attribute.
Because bversion's alignment in bkey is correct as-is, remove the explicit alignment attribute when compiling for big endian.
Reported-by kernel test robot <[email protected]>
Signed-off-by Thomas Bertschinger <[email protected]>
--- fs/bcachefs/bcachefs_format.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/bcachefs/bcachefs_format.h +5 -1
@@ -189,7 +189,11 @@ struct bversion {__u32 hi;__u64 lo;#endif -} __packed__aligned(4) ; +} __packed +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +__aligned(4) +#endif +;struct bkey {/* Size of combined key and value, in u64s */
Signature · 1 line
2.43.0