Skip to contentSkip to conversation

staging: lustre: fix structure size for ARM OABI

PATCH In review Cihangir Akturk 4 participants 5 messages Aug 16, 2017 – Aug 21, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: fix structure size for ARM OABI

When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI.

Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error:

drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ?BUILD_BUG_ON?
BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));

---
 drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +1 -1
index edff8dc..4f72cb6 100644
@@ -388,7 +388,7 @@ struct lov_user_md_v3 {	   /* LOV EA user data (host-endian) */
 		__u16 lmm_layout_gen;     /* layout generation number
 					   * used when reading
 					   */
-	};
+	} __packed;
 	char  lmm_pool_name[LOV_MAXPOOLNAME + 1];   /* pool name */
 	struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */
 } __packed;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 8 lines · Cihangir Akturk

When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI.

Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error:

Quoted 8 lines

drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ‘BUILD_BUG_ON’
BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));

---
 drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This file is no longer in the tree :(

thanks,

greg k-h

#2 lore raw
Quoted 14 lines · Greg KH
Quoted 12 lines · Cihangir Akturk

When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI.

Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error:

drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ?BUILD_BUG_ON?
BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));

Quoted 6 lines
Quoted 4 lines

---
drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

This file is no longer in the tree :(

With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

#3 lore raw
Quoted 7 lines · Greg KH
Quoted 5 lines · Cihangir Akturk
Quoted 3 lines

When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI.

I have to ask are you testing the lustre on ARM?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error:

drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ?BUILD_BUG_ON?
BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

---
drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

This file is no longer in the tree :(

With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h

BTW is __packed valid for UAPI headers?

#4 lore raw
Quoted 9 lines · James Simmons
Quoted 7 lines · Greg KH
Quoted 5 lines · Cihangir Akturk
Quoted 3 lines

When building the kernel for the ARM architecture without setting CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3 differs, due to different alignment requirements of OABI and EABI.

I have to ask are you testing the lustre on ARM?

No, I was just compiling the kernel for ARM architecture, and I hit this issue. If it's possible, I can give it a try with a bunch of raspberry pis or another cheap board?

Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Marking the anonymous union within struct lov_user_md_v3 as '_packed' solves this issue. Otherwise we get the following error:

drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion of macro ?BUILD_BUG_ON?
BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

---
drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

This file is no longer in the tree :(

With James' recent patch series, this has moved to include/uapi/linux/lustre/lustre_user.h

BTW is __packed valid for UAPI headers?