All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] fanotify01: Test setting two marks on different filesystems
Date: Tue, 30 Jan 2024 19:44:51 +0100	[thread overview]
Message-ID: <20240130184451.GA873803@pevik> (raw)
In-Reply-To: <CAOQ4uxi+0us5cq5BhoLoPDCbZgeqhtWiK4UCDV5HaZ+aZQwCLw@mail.gmail.com>

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.

Kind regards,
Petr

[1] https://github.com/pevik/ltp/commit/359047c97151d87b4e709bbabaaa529a31bcc50b

> Thanks,
> Amir.

> --- a/testcases/kernel/syscalls/fanotify/fanotify01.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
> @@ -364,12 +364,19 @@ static void setup(void)
>         mount_mark_fid_unsupported =
> fanotify_flags_supported_on_fs(FAN_REPORT_FID,

> FAN_MARK_MOUNT,

> FAN_OPEN, fname);
> -       /* When mount mark is not supported due to zero fsid, multi fs
> inode marks are not supported */
> +       /*
> +        * When mount mark is not supported due to zero fsid (e.g.
> fuse) or if TMPDIR has non-uniform
> +        * fsid (e.g. btrfs subvol), multi fs inode marks are not supported.
> +        */
>         if (mount_mark_fid_unsupported && errno == ENODEV) {
>                 tst_res(TINFO, "filesystem %s does not support
> reporting events with fid from multi fs",
>                                 tst_device->fs_type);
>                 inode_mark_fid_xdev = EXDEV;
>         }
> +       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");
> +       }
>  }

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-01-30 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 11:05 [LTP] [PATCH] fanotify01: Test setting two marks on different filesystems Amir Goldstein
2024-01-25 12:23 ` Petr Vorel
2024-01-25 13:45   ` Amir Goldstein
2024-01-25 14:44     ` Petr Vorel
2024-01-26  7:38       ` Amir Goldstein
2024-01-26 11:44 ` Jan Kara
2024-01-30 13:07 ` Petr Vorel
2024-01-30 14:58   ` Amir Goldstein
2024-01-30 18:44     ` Petr Vorel [this message]
2024-01-30 19:22       ` Amir Goldstein
2024-01-30 20:26         ` Petr Vorel
2024-01-30 21:31     ` Jan Kara

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=20240130184451.GA873803@pevik \
    --to=pvorel@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.