Skip to contentSkip to conversation

foo

LTP Petr Vorel 2 participants 4 messages Apr 8, 2025 – Apr 11, 2025

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi Amir, Jan,

LTP tested on btrfs on TMPDIR is skipped with TCONF:
# TMPDIR=/var/tmp ./fanotify23
tst_tmpdir.c:316: TINFO: Using /var/tmp/LTP_fanzN3sOS as tmpdir (btrfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_fanzN3sOS/fs_mnt fstyp=ext2 flags=0 tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:233: TCONF: FAN_ATTRIB not supported on ext2 filesystem

The same is fanotify22.c
fanotify22.c:296: TCONF: FAN_FS_ERROR not supported on ext4 filesystem

They work on tmpfs on TMPDIR:

# ./fanotify23
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_fanh6TUn4 as tmpdir (tmpfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0
tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:109: TPASS: FAN_MARK_ADD failed with EEXIST as expected when trying to downgrade to evictable mark
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after empty mask
fanotify23.c:155: TPASS: Got no events as expected
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after drop_caches
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:56: TINFO: Umounting /tmp/LTP_fanh6TUn4/fs_mnt
fanotify23.c:57: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0

Is there a way to avoid TCONF on btrfs?

# df -hT /var/tmp/ /tmp/
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/vda2      btrfs   28G   24G  1.6G  94% /var
tmpfs          tmpfs  1.4G   32K  1.4G   1% /tmp

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

Re: [LTP] [RFC] fanotify: avoid TCONF on btrfs on TMPDIR

Hi Amir, Jan,

The subject was supposed to be "fanotify: avoid TCONF on btrfs on TMPDIR".

Kind regards,
Petr

Quoted 48 lines

LTP tested on btrfs on TMPDIR is skipped with TCONF:
# TMPDIR=/var/tmp ./fanotify23
tst_tmpdir.c:316: TINFO: Using /var/tmp/LTP_fanzN3sOS as tmpdir (btrfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_fanzN3sOS/fs_mnt fstyp=ext2 flags=0 tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:233: TCONF: FAN_ATTRIB not supported on ext2 filesystem

The same is fanotify22.c
fanotify22.c:296: TCONF: FAN_FS_ERROR not supported on ext4 filesystem

They work on tmpfs on TMPDIR:

# ./fanotify23
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_fanh6TUn4 as tmpdir (tmpfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0
tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:109: TPASS: FAN_MARK_ADD failed with EEXIST as expected when trying to downgrade to evictable mark
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after empty mask
fanotify23.c:155: TPASS: Got no events as expected
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after drop_caches
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:56: TINFO: Umounting /tmp/LTP_fanh6TUn4/fs_mnt
fanotify23.c:57: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0

Is there a way to avoid TCONF on btrfs?

# df -hT /var/tmp/ /tmp/
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/vda2      btrfs   28G   24G  1.6G  94% /var
tmpfs          tmpfs  1.4G   32K  1.4G   1% /tmp

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Re: [LTP] [RFC] fanotify: avoid TCONF on btrfs on TMPDIR

Quoted 48 lines · Petr Vorel

Hi Amir, Jan,

The subject was supposed to be "fanotify: avoid TCONF on btrfs on TMPDIR".

Kind regards,
Petr

Quoted 40 lines

LTP tested on btrfs on TMPDIR is skipped with TCONF:
# TMPDIR=/var/tmp ./fanotify23
tst_tmpdir.c:316: TINFO: Using /var/tmp/LTP_fanzN3sOS as tmpdir (btrfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_fanzN3sOS/fs_mnt fstyp=ext2 flags=0 tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:233: TCONF: FAN_ATTRIB not supported on ext2 filesystem

The same is fanotify22.c
fanotify22.c:296: TCONF: FAN_FS_ERROR not supported on ext4 filesystem

They work on tmpfs on TMPDIR:

# ./fanotify23
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_fanh6TUn4 as tmpdir (tmpfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0
tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:109: TPASS: FAN_MARK_ADD failed with EEXIST as expected when trying to downgrade to evictable mark
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after empty mask
fanotify23.c:155: TPASS: Got no events as expected
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after drop_caches
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:56: TINFO: Umounting /tmp/LTP_fanh6TUn4/fs_mnt
fanotify23.c:57: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0

Is there a way to avoid TCONF on btrfs?

I think that should do it:

testcases/kernel/syscalls/fanotify/fanotify22.c +1 -1
@@ -295,7 +295,7 @@ static void setup(void)
 {
        REQUIRE_FANOTIFY_EVENTS_SUPPORTED_ON_FS(FAN_CLASS_NOTIF|FAN_REPORT_FID,
                                                FAN_MARK_FILESYSTEM,
-                                               FAN_FS_ERROR, ".");
+                                               FAN_FS_ERROR, MOUNT_PATH);
        pre_corrupt_fs();
 
        fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF|FAN_REPORT_FID,
(quoted diff) +0 -0

b/testcases/kernel/syscalls/fanotify/fanotify23.c
index 896a8a850..26c9e87fb 100644

testcases/kernel/syscalls/fanotify/fanotify23.c +2 -3
@@ -229,10 +229,10 @@ static void setup(void)
 {
        SAFE_TOUCH(TEST_FILE, 0666, NULL);
 
-       REQUIRE_MARK_TYPE_SUPPORTED_ON_FS(FAN_MARK_EVICTABLE, ".");
+       REQUIRE_MARK_TYPE_SUPPORTED_ON_FS(FAN_MARK_EVICTABLE, MOUNT_PATH);
        REQUIRE_FANOTIFY_EVENTS_SUPPORTED_ON_FS(FAN_CLASS_NOTIF|FAN_REPORT_FID,
                                                FAN_MARK_FILESYSTEM,
-                                               FAN_ATTRIB, ".");
+                                               FAN_ATTRIB, MOUNT_PATH);
 
--
 

I also see a bunch of:

$ git grep 'supported_on_fs.*\"\.\"'
fanotify01.c:   if (fanotify_flags_supported_on_fs(FAN_REPORT_FID,
FAN_MARK_MOUNT, FAN_OPEN, ".")) {
fanotify05.c:   fd_error_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_FD_ERROR, ".");
fanotify11.c:   fan_report_tid_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_TID, ".");
fanotify21.c:           fd_error_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_FD_ERROR, ".");

The first one is intentional.
The two FAN_REPORT_FD_ERROR ones could use MOUNT_PATH, but I don't think that is critical.
There is nothing about those flags that is fs specific, so it is a pure kernel feature test.

The problem with fanotify{22,23} was with the flag FAN_MARK_FILESYSTEM that is not supported on a btrfs subvolume.

Thanks,
Amir.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Re: [LTP] [RFC] fanotify: avoid TCONF on btrfs on TMPDIR

Quoted 71 lines · Petr Vorel
Quoted 48 lines

Hi Amir, Jan,

The subject was supposed to be "fanotify: avoid TCONF on btrfs on TMPDIR".

Kind regards,
Petr

Quoted 40 lines

LTP tested on btrfs on TMPDIR is skipped with TCONF:
# TMPDIR=/var/tmp ./fanotify23
tst_tmpdir.c:316: TINFO: Using /var/tmp/LTP_fanzN3sOS as tmpdir (btrfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_fanzN3sOS/fs_mnt fstyp=ext2 flags=0 tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:233: TCONF: FAN_ATTRIB not supported on ext2 filesystem

The same is fanotify22.c
fanotify22.c:296: TCONF: FAN_FS_ERROR not supported on ext4 filesystem

They work on tmpfs on TMPDIR:

# ./fanotify23
tst_tmpdir.c:316: TINFO: Using /tmp/LTP_fanh6TUn4 as tmpdir (tmpfs filesystem)
tst_device.c:98: TINFO: Found free device 0 '/dev/loop0'
tst_test.c:1194: TINFO: Formatting /dev/loop0 with ext2 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
tst_test.c:1206: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0
tst_test.c:1928: TINFO: LTP version: 20250130-190-g2c79e30c2c
tst_test.c:1932: TINFO: Tested kernel: 6.14.0-3.g5e7754e-default #1 SMP PREEMPT_DYNAMIC Mon Mar 31 14:34:31 UTC 2025 (5e7754e) x86_64
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1748: TINFO: Overall timeout per run is 0h 02m 00s
fanotify23.c:109: TPASS: FAN_MARK_ADD failed with EEXIST as expected when trying to downgrade to evictable mark
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after empty mask
fanotify23.c:155: TPASS: Got no events as expected
fanotify23.c:72: TPASS: FAN_MARK_REMOVE failed with ENOENT as expected after drop_caches
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:196: TPASS: got event: mask=4
fanotify23.c:56: TINFO: Umounting /tmp/LTP_fanh6TUn4/fs_mnt
fanotify23.c:57: TINFO: Mounting /dev/loop0 to /tmp/LTP_fanh6TUn4/fs_mnt fstyp=ext2 flags=0

Is there a way to avoid TCONF on btrfs?

I think that should do it:

testcases/kernel/syscalls/fanotify/fanotify22.c +1 -1
@@ -295,7 +295,7 @@ static void setup(void)
 {
        REQUIRE_FANOTIFY_EVENTS_SUPPORTED_ON_FS(FAN_CLASS_NOTIF|FAN_REPORT_FID,
                                                FAN_MARK_FILESYSTEM,
-                                               FAN_FS_ERROR, ".");
+                                               FAN_FS_ERROR, MOUNT_PATH);
        pre_corrupt_fs();
 
        fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF|FAN_REPORT_FID,
testcases/kernel/syscalls/fanotify/fanotify23.c +0 -0
index 896a8a850..26c9e87fb 100644
@@ -229,10 +229,10 @@ static void setup(void)
 {
        SAFE_TOUCH(TEST_FILE, 0666, NULL);

testcases/kernel/syscalls/fanotify/fanotify23.c static void setup(void) · line 238

Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify23.c +2 -3
 
-       REQUIRE_MARK_TYPE_SUPPORTED_ON_FS(FAN_MARK_EVICTABLE, ".");
+       REQUIRE_MARK_TYPE_SUPPORTED_ON_FS(FAN_MARK_EVICTABLE, MOUNT_PATH);
        REQUIRE_FANOTIFY_EVENTS_SUPPORTED_ON_FS(FAN_CLASS_NOTIF|FAN_REPORT_FID,
                                                FAN_MARK_FILESYSTEM,
-                                               FAN_ATTRIB, ".");
+                                               FAN_ATTRIB, MOUNT_PATH);
 
 
--

Thanks for a hint, indeed it works. I Cced you with a patch.
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://lore.kernel.org/ltp/[email protected]/

Quoted 13 lines

I also see a bunch of:

$ git grep 'supported_on_fs.*\"\.\"'
fanotify01.c:   if (fanotify_flags_supported_on_fs(FAN_REPORT_FID,
FAN_MARK_MOUNT, FAN_OPEN, ".")) {
fanotify05.c:   fd_error_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_FD_ERROR, ".");
fanotify11.c:   fan_report_tid_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_TID, ".");
fanotify21.c:           fd_error_unsupported =
fanotify_init_flags_supported_on_fs(FAN_REPORT_FD_ERROR, ".");
Quoted 3 lines

The first one is intentional.
The two FAN_REPORT_FD_ERROR ones could use MOUNT_PATH, but I don't think that is critical.

+1, therefore I kept it the same.

Kind regards,
Petr

Quoted 8 lines

There is nothing about those flags that is fs specific, so it is a pure kernel feature test.

The problem with fanotify{22,23} was with the flag FAN_MARK_FILESYSTEM that is not supported on a btrfs subvolume.

Thanks,
Amir.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp