[LTP] [PATCH 1/1] fanotify: Handle EOPNOTSUPP as TCONF
Petr Vorel
pvorel@suse.cz
Wed Jan 24 20:42:48 CET 2024
> On Wed, Jan 24, 2024 at 5:33 PM Petr Vorel <pvorel@suse.cz> wrote:
> > > On Wed, Jan 24, 2024 at 2:21 PM Petr Vorel <pvorel@suse.cz> wrote:
> > > > Found on kernel 6.7 (Tumbleweed) on exfat:
> > > > tst_test.c:1669: TINFO: === Testing on exfat ===
> > > > tst_test.c:1117: TINFO: Formatting /dev/loop1 with exfat opts='' extra opts=''
> > > > tst_test.c:1131: TINFO: Mounting /dev/loop1 to /tmp/LTP_fanoL9KLE/mntpoint fstyp=exfat flags=0
> > > > fanotify14.c:246: TINFO: Test case 0: fanotify_init(FAN_CLASS_CONTENT | FAN_REPORT_FID, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 1: fanotify_init(FAN_CLASS_PRE_CONTENT | FAN_REPORT_FID, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 2: fanotify_init(FAN_CLASS_NOTIF, O_RDONLY)
> > > > fanotify14.c:263: TPASS: fanotify_init(tc->init.flags, O_RDONLY) returned fd 5
> > > > fanotify14.c:283: TINFO: Testing FAN_MARK_INODE with INODE_EVENTS
> > > > fanotify14.c:285: TPASS: fanotify_mark(fanotify_fd, 0x00000001 | tc->mark.flags, tc->mask.flags, dirfd, path) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 3: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_FID, O_RDONLY)
> > > > fanotify14.c:263: TPASS: fanotify_init(tc->init.flags, O_RDONLY) returned fd 5
> > > > fanotify14.c:283: TINFO: Testing FAN_MARK_MOUNT with INODE_EVENTS
> > > > fanotify14.c:285: TPASS: fanotify_mark(fanotify_fd, 0x00000001 | tc->mark.flags, tc->mask.flags, dirfd, path) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 4: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_NAME, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 5: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_FID | FAN_REPORT_NAME, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 6: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_TARGET_FID | FAN_REPORT_DFID_NAME, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 7: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_TARGET_FID | FAN_REPORT_DFID_FID, O_RDONLY)
> > > > fanotify14.c:260: TPASS: fanotify_init(tc->init.flags, O_RDONLY) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 8: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_FID, O_RDONLY)
> > > > fanotify14.c:263: TPASS: fanotify_init(tc->init.flags, O_RDONLY) returned fd 5
> > > > fanotify14.c:283: TINFO: Testing FAN_MARK_INODE with FAN_RENAME
> > > > fanotify14.c:285: TPASS: fanotify_mark(fanotify_fd, 0x00000001 | tc->mark.flags, tc->mask.flags, dirfd, path) : EINVAL (22)
> > > > fanotify14.c:246: TINFO: Test case 9: fanotify_init(FAN_CLASS_NOTIF, O_RDONLY)
> > > > fanotify14.c:263: TPASS: fanotify_init(tc->init.flags, O_RDONLY) returned fd 5
> > > > fanotify14.c:283: TINFO: Testing FAN_MARK_ONLYDIR with FAN_OPEN
> > > > fanotify14.c:285: TPASS: fanotify_mark(fanotify_fd, 0x00000001 | tc->mark.flags, tc->mask.flags, dirfd, path) : ENOTDIR (20)
> > > > fanotify14.c:298: TPASS: Adding an inode mark on directory did not fail with ENOTDIR error as on non-dir inode
> > > > fanotify14.c:246: TINFO: Test case 10: fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_NAME_TARGET, O_RDONLY)
> > > > fanotify14.c:263: TPASS: fanotify_init(tc->init.flags, O_RDONLY) returned fd 5
> > > > fanotify14.c:283: TINFO: Testing FAN_MARK_INODE with FAN_DELETE
> > > > fanotify14.c:285: TPASS: fanotify_mark(fanotify_fd, 0x00000001 | tc->mark.flags, tc->mask.flags, dirfd, path) : ENOTDIR (20)
> > > > fanotify14.c:298: TPASS: Adding an inode mark on directory did not fail with ENOTDIR error as on non-dir inode
> > > > fanotify14.c:303: TBROK: fanotify_mark(5, 0x101, 0x200, ..., mntpoint/file1) unsupported: EOPNOTSUPP (95)
> > > > Reported-by: Dominique Leuenberger <dleuenberger@suse.com>
> > > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > > ---
> > > > Hi,
> > > > I wonder, if this is a bug or not.
> > > > Kind regards,
> > > > Petr
> > > > testcases/kernel/syscalls/fanotify/fanotify.h | 12 +++++++++---
> > > > 1 file changed, 9 insertions(+), 3 deletions(-)
> > > > diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
> > > > index e0d178bcc..dd1f5c84c 100644
> > > > --- a/testcases/kernel/syscalls/fanotify/fanotify.h
> > > > +++ b/testcases/kernel/syscalls/fanotify/fanotify.h
> > > > @@ -47,9 +47,15 @@ static inline int safe_fanotify_mark(const char *file, const int lineno,
> > > > rval = fanotify_mark(fd, flags, mask, dfd, pathname);
> > > > if (rval == -1) {
> > > > - tst_brk_(file, lineno, TBROK | TERRNO,
> > > > - "fanotify_mark(%d, 0x%x, 0x%lx, ..., %s) failed",
> > > > - fd, flags, mask, pathname);
> > > > + if (errno == EOPNOTSUPP) {
> > > > + tst_brk_(file, lineno, TCONF | TERRNO,
> > > > + "fanotify_mark(%d, 0x%x, 0x%lx, ..., %s) unsupported",
> > > > + fd, flags, mask, pathname);
> > > > + } else {
> > > > + tst_brk_(file, lineno, TBROK | TERRNO,
> > > > + "fanotify_mark(%d, 0x%x, 0x%lx, ..., %s) failed",
> > > > + fd, flags, mask, pathname);
> > > > + }
> > > > }
> > > > if (rval < -1) {
> > > > --
> > > > 2.43.0
> > Hi Amir,
> > > Petr,
> > > I don't think this is the right fix.
> > > Am I correct to assume that exfat was skipped in this test prior
> > > to v6.8-rc1?
> > > 30ad1938326b fanotify: allow "weak" fsid when watching a single filesystem
> > Yes, it was skipped on 6.6:
> > tst_test.c:1669: TINFO: === Testing on exfat ===
> > tst_test.c:1117: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
> > tst_test.c:1131: TINFO: Mounting /dev/loop0 to /tmp/LTP_fany7fl22/mntpoint fstyp=exfat flags=0
> > fanotify14.c:323: TCONF: FAN_REPORT_FID not supported on exfat filesystem
> > > I have prepared a branch to test the v6.8-rc1 fanotify changes:
> > > https://github.com/amir73il/ltp/commits/fanotify_fsid/
> > > Normally, I post the tests much later in the a release cycle, but the changes
> > > in v6.8-rc1 will cause several new filesystems (e.g. fuse-ntfs3) to start
> > > running the fanotify tests, so we may need to merge some of those test
> > > fixes sooner.
> > +1
> > > Can you please test if the changes in my branch fix this test failure.
> > > Let me know if you need me to post the changes for review.
> > Yes, this your branch fanotify_fsid works on 6.7 from Tumbleweed.
> Ah yes, this is because 6.7 has commit:
> 64343119d7b8 exportfs: support encoding non-decodeable file handles by default
> This is different form the one I mentioned for v6.8-rc1
> > Even cherry picking the commit 3fc9493eb ("fanotify{14,15,16}: Check for
> > filesystem mark support on filesystem") would be enough for now.
> > I can even do it without you sending a patch, if it's ok for you
> > (linking this discussion).
> Perfectly fine by me.
> But note that you need the rest of the fixes to avoid test failures with
> fuse (e.g. fuse-ntfs3g) on v6.8-rc1 - if you care about LTP results on
> latest rc kernel.
NOTE: I would do care but the 2nd commit ("fanotify01: Test setting two marks on
different filesystems") fails at least on 6.7.0 (see below). I'm testing whole
patchset and just commit fixing "fanotify{14,15,16}" and report if more
failures. I'll probably merge now just that single fixing commit.
BTW we have git freeze, planning to release LTP sometimes next week. It would be
great to have working even v6.8-rc1, but understand if you don't have much time
for it.
Kind regards,
Petr
# LTP_SINGLE_FS_TYPE=exfat ./fanotify01
tst_device.c:96: TINFO: Found free device 1 '/dev/loop1'
tst_test.c:1709: TINFO: LTP version: 20230929-298-gc808a4732
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 30s
tst_supported_fs_types.c:161: TINFO: WARNING: testing only exfat
tst_supported_fs_types.c:97: TINFO: Kernel supports exfat
tst_supported_fs_types.c:62: TINFO: mkfs.exfat does exist
tst_test.c:1669: TINFO: === Testing on exfat ===
tst_test.c:1117: TINFO: Formatting /dev/loop1 with exfat opts='' extra opts=''
tst_test.c:1131: TINFO: Mounting /dev/loop1 to /tmp/LTP_fan1CYAik/fs_mnt fstyp=exfat flags=0
fanotify01.c:94: TINFO: Test #0: inode mark events
fanotify01.c:301: TPASS: got event: mask=31 pid=10048 fd=4
fanotify01.c:301: TPASS: got event: mask=11 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=10 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2a pid=10048 fd=5
fanotify01.c:301: TPASS: got event: mask=a pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=20 pid=10048 fd=7
fanotify01.c:301: TPASS: got event: mask=b pid=10048 fd=6
fanotify01.c:301: TPASS: got event: mask=9 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2 pid=10048 fd=9
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=8
fanotify01.c:339: TPASS: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") returned fd 0
fanotify01.c:94: TINFO: Test #1: mount mark events
fanotify01.c:301: TPASS: got event: mask=31 pid=10048 fd=4
fanotify01.c:301: TPASS: got event: mask=11 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=10 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2a pid=10048 fd=5
fanotify01.c:301: TPASS: got event: mask=a pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=20 pid=10048 fd=7
fanotify01.c:301: TPASS: got event: mask=b pid=10048 fd=6
fanotify01.c:301: TPASS: got event: mask=9 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2 pid=10048 fd=9
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=8
fanotify01.c:339: TPASS: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") returned fd 0
fanotify01.c:94: TINFO: Test #2: filesystem mark events
fanotify01.c:301: TPASS: got event: mask=31 pid=10048 fd=4
fanotify01.c:301: TPASS: got event: mask=11 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=10 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2a pid=10048 fd=5
fanotify01.c:301: TPASS: got event: mask=a pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=20 pid=10048 fd=7
fanotify01.c:301: TPASS: got event: mask=b pid=10048 fd=6
fanotify01.c:301: TPASS: got event: mask=9 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2 pid=10048 fd=9
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=8
fanotify01.c:339: TPASS: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") returned fd 0
fanotify01.c:94: TINFO: Test #3: inode mark events (FAN_REPORT_FID)
fanotify01.c:301: TPASS: got event: mask=31 pid=10048 fd=-1
fanotify01.c:301: TPASS: got event: mask=11 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=10 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2a pid=10048 fd=-1
fanotify01.c:301: TPASS: got event: mask=a pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=20 pid=10048 fd=-1
fanotify01.c:301: TPASS: got event: mask=b pid=10048 fd=-1
fanotify01.c:301: TPASS: got event: mask=9 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-2
fanotify01.c:301: TPASS: got event: mask=2 pid=10048 fd=-1
fanotify01.c:301: TPASS: got event: mask=8 pid=10048 fd=-1
fanotify01.c:339: TFAIL: fanotify_mark(fd_notify, 0x00000001, 0x00000008, -100, ".") succeeded
fanotify01.c:94: TINFO: Test #4: mount mark events (FAN_REPORT_FID)
fanotify01.c:107: TCONF: FAN_MARK_MOUNT not supported on exfat filesystem
fanotify01.c:94: TINFO: Test #5: filesystem mark events (FAN_REPORT_FID)
fanotify01.c:107: TCONF: FAN_MARK_FILESYSTEM not supported on exfat filesystem
Summary:
passed 51
failed 1
broken 0
skipped 2
warnings 0
> Thanks,
> Amir.
More information about the ltp
mailing list