From 756cde9a4d5382e6375f709228de74437017863f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 29 Sep 2026 06:01:09 +0000 Subject: [PATCH] xfstests: fix musl build (linux/types.h, RWH_WRITE_LIFE_NOT_SET) fs-monitor.c uses __s32/__u32 without , and rw_hint.c uses RWH_WRITE_LIFE_NOT_SET which musl's headers don't define. Add the missing include and a guarded fallback define. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- ...nclude-linux-types.h-for-__s32-__u32.patch | 24 +++++++++++++++ ...lback-define-for-RWH_WRITE_LIFE_NOT_.patch | 29 +++++++++++++++++++ .../xfstests/xfstests_2026.06.21.bb | 2 ++ 3 files changed, 55 insertions(+) create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch create mode 100644 meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch b/meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch new file mode 100644 index 0000000000..74b1d42f57 --- /dev/null +++ b/meta-filesystems/recipes-utils/xfstests/xfstests/0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch @@ -0,0 +1,24 @@ +From: Khem Raj +Date: Tue, 29 Sep 2026 02:03:26 +0000 +Subject: [PATCH] fs-monitor: include linux/types.h for __s32/__u32 + +The local fallback definition of "struct fanotify_event_info_error" +(used when the libc's predates FAN_FS_ERROR) uses the +kernel-style __s32/__u32 typedefs. glibc's headers happen to pull +these in transitively via other system headers, but musl does not, so +building against musl fails with "unknown type name '__s32'/'__u32'" +unless is included directly. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- +--- a/src/fs-monitor.c ++++ b/src/fs-monitor.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #ifndef FAN_FS_ERROR + #define FAN_FS_ERROR 0x00008000 diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch b/meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch new file mode 100644 index 0000000000..a69dd6811b --- /dev/null +++ b/meta-filesystems/recipes-utils/xfstests/xfstests/0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch @@ -0,0 +1,29 @@ +From: Khem Raj +Date: Tue, 29 Sep 2026 02:03:26 +0000 +Subject: [PATCH] rw_hint: add fallback define for RWH_WRITE_LIFE_NOT_SET + +The musl shipped in this toolchain mistakenly names the +"not set" write-hint constant RWF_WRITE_LIFE_NOT_SET instead of the +kernel uapi's RWH_WRITE_LIFE_NOT_SET (the other RWH_WRITE_LIFE_* +values are spelled correctly), while glibc's +defines RWH_WRITE_LIFE_NOT_SET as expected. Guard a local fallback +definition so the test builds against either libc, without needing to +pull in and risk clashing with musl's own F_*_RW_HINT +macro values. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- +--- a/src/rw_hint.c ++++ b/src/rw_hint.c +@@ -7,6 +7,10 @@ + #include + #include + ++#ifndef RWH_WRITE_LIFE_NOT_SET ++#define RWH_WRITE_LIFE_NOT_SET 0 ++#endif ++ + int main(int argc, char **argv) + { + uint64_t hint = -1; diff --git a/meta-filesystems/recipes-utils/xfstests/xfstests_2026.06.21.bb b/meta-filesystems/recipes-utils/xfstests/xfstests_2026.06.21.bb index ad1ceea463..f6f246332e 100644 --- a/meta-filesystems/recipes-utils/xfstests/xfstests_2026.06.21.bb +++ b/meta-filesystems/recipes-utils/xfstests/xfstests_2026.06.21.bb @@ -13,6 +13,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git;branch=master;ta file://0002-Add-missing-STATX_ATTR_-defines-from-musl-sys-stat.h.patch \ file://0001-bstat-use-uint32_t-instead-of-__uint32_t-to-fix-buil.patch \ file://0001-locktest-do-not-tie-struct-delegation-to-the-F_GETDE.patch \ + file://0003-fs-monitor-include-linux-types.h-for-__s32-__u32.patch \ + file://0004-rw_hint-add-fallback-define-for-RWH_WRITE_LIFE_NOT_.patch \ "