From: James Simmons Date: Thu, 24 Apr 2025 18:26:30 +0000 (-0400) Subject: LU-12511 utils: fix build issues with native client X-Git-Tag: 2.16.55~40 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=7a7b3eda35236a981a960002f93ac146dfc3124c;p=fs%2Flustre-release.git LU-12511 utils: fix build issues with native client A few bugs have crept in that breaks building the lustre utilies against the native client. One set of breakage is the wrong paths for UAPI lustre headers. A few server only data structures have shown up so only conditionally build them. Lastly for liblustreapi_ioctl.c we need stdlib.h so it builds properly. Otherwise we get the build error: liblustreapi_ioctl.c:63:11: error: incompatible implicit declaration of built-in function ‘malloc’ [-Werror] liblustreapi_ioctl.c:63:11: note: include ‘’ or provide a declaration of ‘malloc’ Test-Parameters: trivial Change-Id: If942cef0fd810a918ef3953f7920021b5a5f8360 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58952 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Timothy Day Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 0118ed8..3591b92 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -78,7 +78,7 @@ #include #include #include "lstddef.h" -#include +#include #include "callvpe.h" #ifndef NSEC_PER_SEC diff --git a/lustre/utils/liblustreapi_ioctl.c b/lustre/utils/liblustreapi_ioctl.c index 296f3f9..6989c93 100644 --- a/lustre/utils/liblustreapi_ioctl.c +++ b/lustre/utils/liblustreapi_ioctl.c @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 6f37cec..64a763c 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -78,7 +78,7 @@ #include #include -#include +#include #define MAX_STRING_SIZE 128 diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 4e7fa9c..18881a2 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1482,8 +1482,10 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_DMV_IMP_INHERIT); LASSERTF(OBD_CONNECT2_ENCRYPT_FID2PATH == 0x40000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_ENCRYPT_FID2PATH); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(OBD_CONNECT2_REPLAY_CREATE == 0x80000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_REPLAY_CREATE); +#endif LASSERTF(OBD_CONNECT2_LARGE_NID == 0x100000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_LARGE_NID); LASSERTF(OBD_CONNECT2_COMPRESS == 0x200000000ULL, "found 0x%.16llxULL\n", @@ -4823,7 +4825,6 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct quota_body, qb_padding1[4])); LASSERTF((int)sizeof(((struct quota_body *)0)->qb_padding1[4]) == 8, "found %lld\n", (long long)(int)sizeof(((struct quota_body *)0)->qb_padding1[4])); -#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_target_info */ LASSERTF((int)sizeof(struct mgs_target_info) == 4544, "found %lld\n", @@ -4876,6 +4877,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct mgs_target_info, mti_nidlist[0])); LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_nidlist[0]) == 64, "found %lld\n", (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_nidlist[0])); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_nidtbl_entry */ LASSERTF((int)sizeof(struct mgs_nidtbl_entry) == 24, "found %lld\n",