0001-configure-Fix-build-on-kernel-6.14-headers.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 3ef4bac1dd253628dfdb8a823b51ae0d24fa0616 Mon Sep 17 00:00:00 2001
  2. From: Petr Vorel <pvorel@suse.cz>
  3. Date: Mon, 2 Jun 2025 19:08:30 +0200
  4. Subject: [PATCH] configure: Fix build on kernel 6.14 headers
  5. We decided in a2300dc0f5 to remove <linux/mount.h> in lapi/mount.h and
  6. use only <sys/mount.h>. But later in 5c5411ea8e we add autotools checks
  7. in configure.ac which use <linux/mount.h> for detection, but kept using
  8. lapi/mount.h. This worked until now, because no toolchain used new
  9. header enough. Recent Alpine update broke that.
  10. This fixes CI build on Alpine v3.22 (the default Alpine version in
  11. GitHub action), which uses 6.14.2 kernel headers, which already define
  12. struct mnt_id_req (configure.ac detect it but lapi/mount.h was not using
  13. a correct header):
  14. listmount.h: In function 'listmount':
  15. listmount.h:18:16: error: variable 'req' has initializer but incomplete type
  16. 18 | struct mnt_id_req req = {
  17. | ^~~~~~~~~~
  18. Link: https://lore.kernel.org/ltp/20250602170831.404641-1-pvorel@suse.cz/
  19. Fixes: 5c5411ea8e ("Add listmount/statmount fallback declarations")
  20. Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
  21. Acked-by: Jan Stancek <jstancek@redhat.com>
  22. Signed-off-by: Petr Vorel <pvorel@suse.cz>
  23. Upstream: https://github.com/linux-test-project/ltp/commit/3ef4bac1dd253628dfdb8a823b51ae0d24fa0616
  24. ---
  25. configure.ac | 6 ++++--
  26. 1 file changed, 4 insertions(+), 2 deletions(-)
  27. diff --git a/configure.ac b/configure.ac
  28. index 9ff098b273..69c5be7362 100644
  29. --- a/configure.ac
  30. +++ b/configure.ac
  31. @@ -254,8 +254,10 @@ AC_CHECK_TYPES([struct mount_attr],,,[
  32. AC_CHECK_TYPES([struct cachestat_range],,,[#include <sys/mman.h>])
  33. AC_CHECK_TYPES([struct cachestat],,,[#include <sys/mman.h>])
  34. -AC_CHECK_TYPES([struct mnt_id_req],,,[#include <linux/mount.h>])
  35. -AC_CHECK_TYPES([struct statmount],,,[#include <linux/mount.h>])
  36. +
  37. +# Defined in <linux/mount.h>, but include/lapi/mount.h includes <sys/mount.h> */
  38. +AC_CHECK_TYPES([struct mnt_id_req],,,[#include <sys/mount.h>])
  39. +AC_CHECK_TYPES([struct statmount],,,[#include <sys/mount.h>])
  40. # Tools knobs
  41. --
  42. 2.50.0