diff options
author | Amir Goldstein <amir73il@gmail.com> | 2024-01-24 16:22:38 +0200 |
---|---|---|
committer | Petr Vorel <pvorel@suse.cz> | 2024-01-24 21:41:49 +0100 |
commit | 921f0ce869097daca035ed234f3fc351124585cc (patch) | |
tree | 6648965db904ed62ae02390c079085f9aa404672 | |
parent | e8118359b45c4a645fffe30fdd33efb0d14dec47 (diff) | |
download | ltp-921f0ce869097daca035ed234f3fc351124585cc.tar.gz |
fanotify13: Use generic check for mark type support on filesystem
This test has a specific check for AT_HANDLE_FID file handles, which is
a specific reason for a filesystem (e.g. overlayfs) not supporting
filesystem and mount marks with FAN_REPORT_FID.
We now have a generic check for mark type support on filesystem, so use
the more generic check instead of the specific AT_HANDLE_FID check, do
decide if test case needs to be run.
There are now filesystems other than overlayfs (e.g. fuse) that do not
support filesystem and mount marks with FAN_REPORT_FID, so this test
now runs correctly on those filesystems as well (tested with ntfs-3g).
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
-rw-r--r-- | testcases/kernel/syscalls/fanotify/fanotify13.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/testcases/kernel/syscalls/fanotify/fanotify13.c b/testcases/kernel/syscalls/fanotify/fanotify13.c index fdde3b10d..6086a81fc 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify13.c +++ b/testcases/kernel/syscalls/fanotify/fanotify13.c @@ -158,13 +158,8 @@ static void do_test(unsigned int number) return; } - if (at_handle_fid && mark->flag != FAN_MARK_INODE) { - tst_res(TCONF, "overlayfs does not support decodeable file handles required by %s", mark->name); - return; - } - - if (filesystem_mark_unsupported && mark->flag & FAN_MARK_FILESYSTEM) { - tst_res(TCONF, "FAN_MARK_FILESYSTEM not supported in kernel?"); + if (filesystem_mark_unsupported && mark->flag != FAN_MARK_INODE) { + FANOTIFY_MARK_FLAGS_ERR_MSG(mark, filesystem_mark_unsupported); return; } @@ -325,9 +320,6 @@ static void do_setup(void) SAFE_MOUNT(mnt, MOUNT_PATH, "none", MS_BIND, NULL); bind_mounted = 1; - filesystem_mark_unsupported = fanotify_mark_supported_on_fs(FAN_MARK_FILESYSTEM, - MOUNT_PATH); - nofid_fd = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY); /* Create file and directory objects for testing on base fs */ @@ -339,6 +331,10 @@ static void do_setup(void) ovl_bind_mounted = 1; } + filesystem_mark_unsupported = + fanotify_flags_supported_on_fs(FAN_REPORT_FID, FAN_MARK_FILESYSTEM, FAN_OPEN, + ovl_bind_mounted ? OVL_MNT : MOUNT_PATH); + /* * Create a mark on first inode without FAN_REPORT_FID, to test * uninitialized connector->fsid cache. This mark remains for all test |