[LTP] [PATCH] fanotify01: Test setting two marks on different filesystems

Petr Vorel pvorel@suse.cz
Tue Jan 30 21:26:06 CET 2024


> On Tue, Jan 30, 2024 at 8:44 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Amir,

> > > On Tue, Jan 30, 2024 at 3:07 PM Petr Vorel <pvorel@suse.cz> wrote:

> > > > Hi Amir, Jan,

> > > > I was going to merge, but I suspect this does not work on TMPDIR on btrfs.


> > > This is a problem because the test result depends on the type of TMPDIR.
> > > The failure in your case is because TMPDIR is not only btrfs, but a
> > > btrfs subvol.
> > > Jan has dealt with several related fanotify tests failures lately.

> > > > Tested on SLE 15-SP6 (kernel 6.4), on 15-SP4 (kernel 5.14), Tumbleweed (kernel
> > > > 6.8.0-rc1), Alpine Linux (kernel 6.4) I get:

> > > > fanotify01.c:341: TFAIL: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") failed: EXDEV (18)

> > > > for tests #3, #4 and #5 on all filesystems.

> > > > Testing on other on other filesystem it works: Debian kernel 5.10, 6.1 on ext4,
> > > > Alpine Linux kernel 6.4 on tmpfs, Tumbleweed kernel 6.8.0-rc1 on tmpfs.

> > > > Should be btrfs handled differently or skipped? (below)
> > > > Or test EXDEV for #3, #4 and #5? (not sure how handle just half of the tests on
> > > > btrfs differently).

> > > > Kind regards,
> > > > Petr

> > > > diff --git testcases/kernel/syscalls/fanotify/fanotify01.c testcases/kernel/syscalls/fanotify/fanotify01.c
> > > > index ba09f309d..97ade1829 100644
> > > > --- testcases/kernel/syscalls/fanotify/fanotify01.c
> > > > +++ testcases/kernel/syscalls/fanotify/fanotify01.c
> > > > @@ -335,8 +335,15 @@ pass:
> > > >          * different filesystems are supported.
> > > >          * When tested fs has zero fsid (e.g. fuse) and events are reported
> > > >          * with fsid+fid, watching different filesystems is not supported.
> > > > +        * Not supported on Btrfs.
> > > >          */
> > > > +       if (tst_fs_type(".") == TST_BTRFS_MAGIC) {
> > > > +               tst_res(TCONF, "skipped on Btrfs");
> > > > +               return;
> > > > +       }
> > > > +

> > > Note that btrfs is not the FS under test. It is the FS of TMPFS,
> > > so even if you did skip, this message would have been wrong.

> > > Please try the patch below.

> > Great, works as expected.

> > I can merge amended commit [1], or feel free to send v2 if you want to mention
> > btrfs subvol in the commit message.


> Amended commit looks fine.

> I don't think there is a need to specify btrfs subvol TMPDIR in the
> commit message.
> It is a minor implementation detail, not the main thing.

Good, merged!

Thanks!
Petr

> Thanks,
> Amir.


More information about the ltp mailing list