[LTP] fanotify21: fix test failure when running iterations

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Thu May 28 18:03:14 CEST 2026


Hi Amir,

On Thu, 28 May 2026 17:19:38 +0200, Amir Goldstein wrote:
> fanotify21: fix test failure when running iterations

> +/* Bind mount so remount ro/rw always work */
> +SAFE_MOUNT(MOUNT_PATH, MOUNT_PATH, "none", MS_BIND, NULL);

The self-bind-mount approach is clean — it decouples the remount
ro/rw state from the underlying filesystem type, removing both the
FUSE special-case and the need for tst_device->fs_type in the remount
call.

> -if (tc->remount_ro) {
> -/* SAFE_MOUNT fails to remount FUSE */
> -if (mount(tst_device->dev, MOUNT_PATH, tst_device->fs_type,
> -  MS_REMOUNT|MS_RDONLY, NULL) != 0) {
> -tst_brk(TFAIL,
> -"filesystem %s failed to remount readonly",
> -tst_device->fs_type);
> -}
> -}
> +/* remount ro/rw the bind mount */
> +SAFE_MOUNT("none", MOUNT_PATH, "none", MS_BIND | MS_REMOUNT |
> +   (tc->remount_ro ? MS_RDONLY : 0), NULL);

Good — always remounting to the correct state (rw or ro) before each
test case is exactly what was missing and explains the -i2 failure.

> +/* Unmount the bind mount */
> +SAFE_UMOUNT(MOUNT_PATH);

Correct. The bind mount is cleaned up before the LTP framework
unmounts the underlying device.

> +Reported-by: pvorel@suse.cz

Missing full name. Should be:

  Reported-by: Petr Vorel <pvorel@suse.cz>

[...]

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list