diff --git a/package/ltp-testsuite/0001-configure-Fix-build-on-kernel-6.14-headers.patch b/package/ltp-testsuite/0001-configure-Fix-build-on-kernel-6.14-headers.patch new file mode 100644 index 0000000000..6638ee2ccd --- /dev/null +++ b/package/ltp-testsuite/0001-configure-Fix-build-on-kernel-6.14-headers.patch @@ -0,0 +1,51 @@ +From 3ef4bac1dd253628dfdb8a823b51ae0d24fa0616 Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Mon, 2 Jun 2025 19:08:30 +0200 +Subject: [PATCH] configure: Fix build on kernel 6.14 headers + +We decided in a2300dc0f5 to remove in lapi/mount.h and +use only . But later in 5c5411ea8e we add autotools checks +in configure.ac which use 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 = { + | ^~~~~~~~~~ + +Link: https://lore.kernel.org/ltp/20250602170831.404641-1-pvorel@suse.cz/ +Fixes: 5c5411ea8e ("Add listmount/statmount fallback declarations") +Reviewed-by: Cyril Hrubis +Acked-by: Jan Stancek +Signed-off-by: Petr Vorel +Upstream: https://github.com/linux-test-project/ltp/commit/3ef4bac1dd253628dfdb8a823b51ae0d24fa0616 +--- + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9ff098b273..69c5be7362 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -254,8 +254,10 @@ AC_CHECK_TYPES([struct mount_attr],,,[ + + AC_CHECK_TYPES([struct cachestat_range],,,[#include ]) + AC_CHECK_TYPES([struct cachestat],,,[#include ]) +-AC_CHECK_TYPES([struct mnt_id_req],,,[#include ]) +-AC_CHECK_TYPES([struct statmount],,,[#include ]) ++ ++# Defined in , but include/lapi/mount.h includes */ ++AC_CHECK_TYPES([struct mnt_id_req],,,[#include ]) ++AC_CHECK_TYPES([struct statmount],,,[#include ]) + + # Tools knobs + +-- +2.50.0 + diff --git a/package/ltp-testsuite/0002-statmount02-Remove-linux-btrfs.h.patch b/package/ltp-testsuite/0002-statmount02-Remove-linux-btrfs.h.patch new file mode 100644 index 0000000000..c82c422000 --- /dev/null +++ b/package/ltp-testsuite/0002-statmount02-Remove-linux-btrfs.h.patch @@ -0,0 +1,52 @@ +From fe8c0dac5ab4aa49c4f977d14f8a8d24cefa6435 Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Wed, 4 Jun 2025 16:13:18 +0200 +Subject: [PATCH] statmount02: Remove + +statmount02.c does not need because it's skipped. + +Avoid using it fixes the problem due the old problem of indirect include + by on Alpine v3.22 (the default Alpine +version in GitHub action), which uses 6.14.2 kernel headers: + + In file included from /usr/include/linux/fs.h:19, + from /usr/include/linux/btrfs.h:29, + from statmount02.c:23: + /usr/include/linux/mount.h:155:8: error: redefinition of 'struct statmount' + 155 | struct statmount { + | ^~~~~~~~~ + In file included from statmount.h:12, + from statmount02.c:20: + ../../../../include/lapi/mount.h:58:8: note: originally defined here + 58 | struct statmount { + | ^~~~~~~~~ + /usr/include/linux/mount.h:193:8: error: redefinition of 'struct mnt_id_req' + 193 | struct mnt_id_req { + | ^~~~~~~~~~ + ../../../../include/lapi/mount.h:49:8: note: originally defined here + 49 | struct mnt_id_req { + | ^~~~~~~~~~ + +Fixes: 5f9942dffe ("Add statmount02 test") +Suggested-by: Jan Stancek +Signed-off-by: Petr Vorel +Upstream: https://github.com/linux-test-project/ltp/commit/fe8c0dac5ab4aa49c4f977d14f8a8d24cefa6435 +--- + testcases/kernel/syscalls/statmount/statmount02.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/statmount/statmount02.c b/testcases/kernel/syscalls/statmount/statmount02.c +index 504c558a11..07f877e040 100644 +--- a/testcases/kernel/syscalls/statmount/statmount02.c ++++ b/testcases/kernel/syscalls/statmount/statmount02.c +@@ -20,7 +20,6 @@ + #include "statmount.h" + #include "lapi/stat.h" + #include "lapi/sched.h" +-#include + + #define MNTPOINT "mntpoint" + +-- +2.50.0 + diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk index 1a401c0421..8be3b21b38 100644 --- a/package/ltp-testsuite/ltp-testsuite.mk +++ b/package/ltp-testsuite/ltp-testsuite.mk @@ -11,6 +11,9 @@ LTP_TESTSUITE_SITE = https://github.com/linux-test-project/ltp/releases/download LTP_TESTSUITE_LICENSE = GPL-2.0, GPL-2.0+ LTP_TESTSUITE_LICENSE_FILES = COPYING +# 0001-configure-Fix-build-on-kernel-6.14-headers.patch +LTP_TESTSUITE_AUTORECONF = YES + LTP_TESTSUITE_CONF_OPTS += --disable-metadata ifeq ($(BR2_PACKAGE_LTP_TESTSUITE_OPEN_POSIX),y)