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

Petr Vorel pvorel@suse.cz
Tue Jan 30 14:07:12 CET 2024


Hi Amir, Jan,

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

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;
+	}
+
 	ret = report_fid ? inode_mark_fid_xdev : 0;
+
 	TST_EXP_FD_OR_FAIL(fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_CLOSE_WRITE,
 					 AT_FDCWD, "."), ret);
 


More information about the ltp mailing list