Whamcloud - gitweb
LU-16335 build: remove _GNU_SOURCE dependency in lustre_user.h 76/49776/2
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 26 Jan 2023 03:12:08 +0000 (19:12 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 Mar 2023 06:44:17 +0000 (06:44 +0000)
commit8a8747d319aa3f91674b156c79d44cbc092ee175
tree386bc32bf387107235b000fb70abae6c6b844350
parent4ebc91a7b8caea4a99529fa00f9713c9e45033be
LU-16335 build: remove _GNU_SOURCE dependency in lustre_user.h

The lustre_user.h header uses the non-standard strchrnul() function
in userspace.  This will always leads to LC_IOC_REMOVE_ENTRY configure
check to fail, and in the end "lfs rm_entry" always returns -ENOTSUP.

Implement an alternative approach to avoid external dependencies on
the lustre_user.h header.  Also, LC_IOC_REMOVE_ENTRY is itself
unnecessary, the code can check for LL_IOC_REMOVE_ENTRY directly.

Replace the NFS-specific -ENOTSUP error return code with -EOPNOTSUPP.

Fix the compile test_400[ab] checks to not use "-std=c99" to verify
that the uapi headers are usable without this dependency.

Lustre-change: https://review.whamcloud.com/49328
Lustre-commit: efc5c8d4de60d394344506f7cfb188eaf04a4bac

Fixes: b59835f8b6 ("LU-13903 utils: have liblustreapi support Linux client")
Fixes: 7a7309fa84 ("LU-13274 uapi: make lustre UAPI headers C99 compliant")
Fixes: 6331eadbd6 ("LU-15420 uapi: avoid gcc-11 -Werror=stringop-overread")
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: If42743a2148c317b8a9b701ceb5d08bac5149f5f
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49776
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
config/lustre-build.m4
lustre/autoconf/lustre-core.m4
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/tests/sanity.sh
lustre/utils/liblustreapi_util.c