[LTP] stable-rc: 5.4 and 5.10: fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") expected EXDEV: ENODEV (19)

Amir Goldstein amir73il@gmail.com
Thu Jun 26 11:57:12 CEST 2025


On Thu, Jun 26, 2025 at 9:03 AM Naresh Kamboju
<naresh.kamboju@linaro.org> wrote:
>
> Regression in the LTP syscalls/fanotify01 test on the Linux stable-rc 5.4
> and 5.10 kernel after upgrading to LTP version 20250530.
>
>  - The test passed with LTP version 20250130
>  - The test fails with LTP version 20250530
>
> Regressions found on stable-rc 5.4 and 5.10 LTP syscalls fanotify01.c
> fanotify_mark expected EXDEV: ENODEV (19)
>
> Regression Analysis:
>  - New regression? Yes
>  - Reproducibility? Yes
>
> Test regression: stable-rc 5.4 and 5.10
>
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
>
> fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001,
> 0x00000008, -100, ".") expected EXDEV: ENODEV (19)
>
> The test expected fanotify_mark() to fail with EXDEV, but received
> ENODEV instead. This indicates a potential mismatch between updated
> LTP test expectations and the behavior of the 5.4 kernel’s fanotify
> implementation.
>

Yap, that's true.

The change to fanotify01:
* db197b7b5 - fanotify01: fix test failure when running with nfs TMPDIR

Depends on this kernel change from v6.8:
* 30ad1938326b - fanotify: allow "weak" fsid when watching a single filesystem

Which fs type is your LTP TMPDIR?

Can you please test this fix:

--- a/testcases/kernel/syscalls/fanotify/fanotify01.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
@@ -374,7 +374,21 @@ static void setup(void)
        }

        if (fanotify_flags_supported_on_fs(FAN_REPORT_FID,
FAN_MARK_MOUNT, FAN_OPEN, ".")) {
-               inode_mark_fid_xdev = (errno == ENODEV) ? EXDEV : errno;
+               inode_mark_fid_xdev = errno;
+               if (inode_mark_fid_xdev == ENODEV) {
+                       /*
+                        * The fs on TMPDIR has zero fsid.
+                        * On kernels <  v6.8 an inode mark fails with ENODEV.
+                        * On kernels >= v6.8 an inode mark is allowed but multi
+                        * fs inode marks will fail with EXDEV.
+                        * See kernel commit 30ad1938326b
+                        * ("fanotify: allow "weak" fsid when watching
a single filesystem").
+                        */
+                       if
(fanotify_flags_supported_on_fs(FAN_REPORT_FID, FAN_MARK_INODE,
FAN_OPEN, "."))
+                               inode_mark_fid_xdev = errno;
+                       else
+                               inode_mark_fid_xdev = EXDEV;
+               }
                tst_res(TINFO | TERRNO, "TMPDIR does not support
reporting events with fid from multi fs");
        }
 }


Thanks,
Amir.

> Test log,
> --
>
> fanotify01.c:94: TINFO: Test #3: inode mark events (FAN_REPORT_FID)
> fanotify01.c:301: TPASS: got event: mask=31 pid=2364 fd=-1
> ...
> fanotify01.c:301: TPASS: got event: mask=8 pid=2364 fd=-1
> fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001,
> 0x00000008, -100, ".") expected EXDEV: ENODEV (19)
> fanotify01.c:94: TINFO: Test #4: mount mark events (FAN_REPORT_FID)
> fanotify01.c:301: TPASS: got event: mask=31 pid=2364 fd=-1
> ...
> fanotify01.c:301: TPASS: got event: mask=8 pid=2364 fd=-1
> fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001,
> 0x00000008, -100, ".") expected EXDEV: ENODEV (19)
> fanotify01.c:94: TINFO: Test #5: filesystem mark events (FAN_REPORT_FID)
> fanotify01.c:301: TPASS: got event: mask=31 pid=2364 fd=-1
> ...
> fanotify01.c:301: TPASS: got event: mask=8 pid=2364 fd=-1
> fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001,
> 0x00000008, -100, ".") expected EXDEV: ENODEV (19)
>
>
> ## Test logs
> * Build details:
> https://regressions.linaro.org/lkft/linux-stable-rc-linux-5.4.y/v5.4.294-223-g7ff2d32362e4/ltp-syscalls/fanotify01/
> * Build detail 2:
> https://regressions.linaro.org/lkft/linux-stable-rc-linux-5.10.y/v5.10.238-353-g9dc843c66f6f/ltp-syscalls/fanotify01/
> * Test log: https://qa-reports.linaro.org/api/testruns/28859312/log_file/
> * Issue: https://regressions.linaro.org/-/known-issues/6609/
> * Test LAVA job 1:
> https://lkft.validation.linaro.org/scheduler/job/8329278#L28572
> * Test LAVA job 2:
> https://lkft.validation.linaro.org/scheduler/job/8326518#L28491
> * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2yxHGvVkVpcbKqPahSKRnlITnVS/
> * Build config:
> https://storage.tuxsuite.com/public/linaro/lkft/builds/2yxHGvVkVpcbKqPahSKRnlITnVS/bzImage
>
>
> --
> Linaro LKFT
> https://lkft.linaro.org


More information about the ltp mailing list