From: Donald Douwsma <ddouwsma@redhat.com>
To: Lukas Herbolt <lukas@herbolt.com>, fstests@vger.kernel.org
Cc: zlang@kernel.org
Subject: Re: [PATCH] fstests Fix build errors on kernels before v5.1
Date: Thu, 23 Jul 2026 15:03:01 +1000 [thread overview]
Message-ID: <a2ed9331-795f-4604-9267-d2946e4beb35@redhat.com> (raw)
In-Reply-To: <20260722052256.2406451-3-lukas@herbolt.com>
On 22/7/26 15:22, Lukas Herbolt wrote:
> The FAN_REPORT_FID and fanotify_event_info_fid were introduced
> in v5.1. Currently there is no check if the kernel supports it
> making xfstests build to fail on older kernels.
>
> Fixes: 29d120e41c3d ("generic: test fsnotify filesystem error reporting")
>
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
Looks good!
Reviewed-by: Donald Douwsma <ddouwsma@redhat.com>
> ---
> configure.ac | 1 +
> include/builddefs.in | 1 +
> m4/package_libcdev.m4 | 14 ++++++++++++++
> src/Makefile | 6 +++++-
> 4 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 441f543c6089..feb24ddd8854 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -74,6 +74,7 @@ AC_NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
> AC_HAVE_FICLONE
> AC_HAVE_TRIVIAL_AUTO_VAR_INIT
> AC_HAVE_FILE_GETATTR
> +AC_HAVE_FANOTIFY_FID
>
> AC_CHECK_FUNCS([renameat2])
> AC_CHECK_FUNCS([reallocarray])
> diff --git a/include/builddefs.in b/include/builddefs.in
> index 708d75b24d76..8e9e2e3b4113 100644
> --- a/include/builddefs.in
> +++ b/include/builddefs.in
> @@ -75,6 +75,7 @@ HAVE_RLIMIT_NOFILE = @have_rlimit_nofile@
> NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE = @need_internal_xfs_ioc_exchange_range@
> HAVE_FICLONE = @have_ficlone@
> HAVE_FILE_GETATTR = @have_file_getattr@
> +HAVE_FANOTIFY_FID = @have_fanotify_fid@
>
> GCCFLAGS = -std=gnu11 -funsigned-char -fno-strict-aliasing -Wall
> SANITIZER_CFLAGS += @autovar_init_cflags@
> diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
> index 17f57f427410..340cdad3faf9 100644
> --- a/m4/package_libcdev.m4
> +++ b/m4/package_libcdev.m4
> @@ -102,3 +102,17 @@ AC_DEFUN([AC_HAVE_FILE_GETATTR],
> AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
> AC_SUBST(have_file_getattr)
> ])
> +
> +# Check if we have fanotify FID support (Linux 5.1+)
> +AC_DEFUN([AC_HAVE_FANOTIFY_FID],
> + [ AC_MSG_CHECKING([for fanotify FID support])
> + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> +#include <sys/fanotify.h>
> + ]], [[
> + int x = FAN_REPORT_FID;
> + struct fanotify_event_info_fid fid;
> + (void)x; (void)fid;
> + ]])],[have_fanotify_fid=yes
> + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
> + AC_SUBST(have_fanotify_fid)
> + ])
> diff --git a/src/Makefile b/src/Makefile
> index 31ac43b215e9..847fb168181e 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -36,7 +36,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
> fscrypt-crypt-util bulkstat_null_ocount splice-test chprojid_fail \
> detached_mounts_propagation ext4_resize t_readdir_3 splice2pipe \
> uuid_ioctl t_snapshot_deleted_subvolume fiemap-fault min_dio_alignment \
> - rw_hint fs-monitor
> + rw_hint
>
> EXTRA_EXECS = dmerror fill2attr fill2fs fill2fs_check scaleread.sh \
> btrfs_crc32c_forged_name.py popdir.pl popattr.py \
> @@ -107,6 +107,10 @@ ifeq ($(HAVE_FICLONE),yes)
> TARGETS += t_reflink_read_race
> endif
>
> +ifeq ($(HAVE_FANOTIFY_FID),yes)
> + TARGETS += fs-monitor
> +endif
> +
> ifeq ($(HAVE_LIBBTRFSUTIL), true)
> LINUX_TARGETS += t_btrfs_received_uuid_ioctl
> endif
>
> base-commit: acb6d4cb84205a8e3f19ca470cfcf7bf6d93a509
prev parent reply other threads:[~2026-07-23 5:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 5:22 [PATCH] fstests Fix build errors on kernels before v5.1 Lukas Herbolt
2026-07-22 9:35 ` Andrey Albershteyn
2026-07-22 17:49 ` Lukas Herbolt
2026-07-23 5:27 ` Donald Douwsma
2026-07-23 8:26 ` Andrey Albershteyn
2026-07-23 10:48 ` Lukas Herbolt
2026-07-27 18:07 ` Zorro Lang
2026-07-23 5:03 ` Donald Douwsma [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2ed9331-795f-4604-9267-d2946e4beb35@redhat.com \
--to=ddouwsma@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=lukas@herbolt.com \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.