Whamcloud - gitweb
LU-16335 build: remove _GNU_SOURCE dependency in lustre_user.h 28/49328/8
authorLai Siyao <lai.siyao@whamcloud.com>
Thu, 1 Dec 2022 08:17:00 +0000 (03:17 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 20 Dec 2022 16:32:02 +0000 (16:32 +0000)
commitefc5c8d4de60d394344506f7cfb188eaf04a4bac
treef5e3f8ae3c1497b339066ec035b0f60ed5ac68e4
parent37f18670e49b8150170f9b724b5f7089fa176c4e
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.

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-on: https://review.whamcloud.com/c/fs/lustre-release/+/49328
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
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