[LTP] [PATCH 1/2] configure: Fix build on kernel 6.14 headers
Petr Vorel
pvorel@suse.cz
Mon Jun 2 19:08:30 CEST 2025
We decided in a2300dc0f5 to remove <linux/mount.h> in lapi/mount.h and
use only <sys/mount.h>. But later in 5c5411ea8e we add autotools checks
in configure.ac which use <linux/mount.h> for detection, but kept using
lapi/mount.h. This worked until now, because no toolchain used new
header enough. Recent Alpine update broke that.
This fixes CI build on Alpine v3.22 (the default Alpine version in
GitHub action), which uses 6.14.2 kernel headers, which already define
struct mnt_id_req (configure.ac detect it but lapi/mount.h was not using
a correct header):
listmount.h: In function 'listmount':
listmount.h:18:16: error: variable 'req' has initializer but incomplete type
18 | struct mnt_id_req req = {
| ^~~~~~~~~~
Fixes: 5c5411ea8e ("Add listmount/statmount fallback declarations")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,
CI fix (needed to fix already broken CI) for:
https://github.com/linux-test-project/ltp/actions/runs/15395092145/job/43318766502
Alternatively we could use our lapi differently:
lapi/mount.h for <sys/mount.h>
lapi/fsmount.h for <linux/mount.h> (and move there struct mnt_id_req
fallback definition).
If this looks better to you, maybe we should rename these 2 lapi headers
to make it obvious if they use kernel or libc header.
It's not clear to me how we want to use the headers: <sys/mount.h> for
old traditional mount things and <linux/mount.h>? Or do we prefer to
stick with one of them? Probably not, because using <linux/mount.h>
would likely require fallback old things which are only in
<sys/mount.h>.
It's also not clear to me what is more important from testing point:
libc headers or kernel headers.
And we have more mess in <sys/mount.h> vs. <linux/mount.h> use, e.g.
struct mount_attr testing in configure.ac uses the headers differently
than include/lapi/fsmount.h use:
configure.ac
AC_CHECK_TYPES([struct mount_attr],,,[
#ifdef HAVE_MOUNT_SETATTR
# include <sys/mount.h>
#elif HAVE_LINUX_MOUNT_H
# include <linux/mount.h>
#endif
])
include/lapi/fsmount.h
#if !defined(HAVE_FSOPEN) && defined(HAVE_LINUX_MOUNT_H)
# include <linux/mount.h>
#else
# include <sys/mount.h>
#endif
This works now, but it can break any time.
Last, but not least, once we do unification cleanup we could probably
get rid of checking many long existing headers which are part of
AC_CHECK_HEADERS_ONCE. Many of them did existed back then when uapi creation
was done in 3.7-rc1 (and before), but 4.4 we officially support contains
quite a lot of them (e.g. linux/module.h).
Kind regards,
Petr
configure.ac | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7f475f6b64..13cded692f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,8 +253,10 @@ AC_CHECK_TYPES([struct mount_attr],,,[
AC_CHECK_TYPES([struct cachestat_range],,,[#include <sys/mman.h>])
AC_CHECK_TYPES([struct cachestat],,,[#include <sys/mman.h>])
-AC_CHECK_TYPES([struct mnt_id_req],,,[#include <linux/mount.h>])
-AC_CHECK_TYPES([struct statmount],,,[#include <linux/mount.h>])
+
+# Defined in <linux/mount.h>, but include/lapi/mount.h includes <sys/mount.h> */
+AC_CHECK_TYPES([struct mnt_id_req],,,[#include <sys/mount.h>])
+AC_CHECK_TYPES([struct statmount],,,[#include <sys/mount.h>])
# Tools knobs
--
2.49.0
More information about the ltp
mailing list