[LTP] [PATCH] fanotify01: fix test failure when running with nfs TMPDIR

Petr Vorel pvorel@suse.cz
Mon Feb 17 08:17:34 CET 2025


Hi Amir,

> If TMPDIR does not support mount watches due to ENODEV, the failure
> to watch multiple fs would be EXDEV and not ENODEV.

> Reported-by: Rhythm Mahajan <rhythm.m.mahajan@oracle.com>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>  testcases/kernel/syscalls/fanotify/fanotify01.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

> diff --git a/testcases/kernel/syscalls/fanotify/fanotify01.c b/testcases/kernel/syscalls/fanotify/fanotify01.c
> index c7e759166..38f5a0791 100644
> --- a/testcases/kernel/syscalls/fanotify/fanotify01.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
> @@ -375,8 +375,9 @@ static void setup(void)
>  	}

>  	if (fanotify_flags_supported_on_fs(FAN_REPORT_FID, FAN_MARK_MOUNT, FAN_OPEN, ".")) {
> -		inode_mark_fid_xdev = errno;
> -		tst_res(TINFO, "TMPDIR does not support reporting events with fid from multi fs");
> +		inode_mark_fid_xdev = (errno == ENODEV) ? EXDEV : errno;
> +		tst_res(TINFO, "TMPDIR does not support reporting events with fid from multi fs"
> +				" (errno = %d)", errno);

I merged with LTP specific flag TERRNO which prints both string and numeric
value for errno:

		tst_res(TINFO | TERRNO, "TMPDIR does not support reporting events with fid from multi fs");

Thanks for a fix!

Kind regards,
Petr


More information about the ltp mailing list