Whamcloud - gitweb
LU-12511 utils: fix build issues with native client 52/58952/2
authorJames Simmons <jsimmons@infradead.org>
Thu, 24 Apr 2025 18:26:30 +0000 (14:26 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 7 May 2025 21:11:19 +0000 (21:11 +0000)
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 ‘<stdlib.h>’
or provide a declaration of ‘malloc’

Test-Parameters: trivial
Change-Id: If942cef0fd810a918ef3953f7920021b5a5f8360
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58952
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs.c
lustre/utils/liblustreapi_ioctl.c
lustre/utils/obd.c
lustre/utils/wiretest.c

index 0118ed8..3591b92 100644 (file)
@@ -78,7 +78,7 @@
 #include <linux/lnet/nidstr.h>
 #include <lnetconfig/cyaml.h>
 #include "lstddef.h"
-#include <uapi/linux/lustre/lustre_idl.h>
+#include <linux/lustre/lustre_idl.h>
 #include "callvpe.h"
 
 #ifndef NSEC_PER_SEC
index 296f3f9..6989c93 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <string.h>
 #include <stddef.h>
+#include <stdlib.h>
 #include <sys/ioctl.h>
 #include <errno.h>
 
index 6f37cec..64a763c 100644 (file)
@@ -78,7 +78,7 @@
 #include <linux/lustre/lustre_ver.h>
 
 #include <lustre/lustreapi.h>
-#include <uapi/linux/lustre/lustre_disk.h>
+#include <linux/lustre/lustre_disk.h>
 
 #define MAX_STRING_SIZE 128
 
index 4e7fa9c..18881a2 100644 (file)
@@ -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",