From: Amir Goldstein <amir73il@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/5] syscalls/fanotify01: add test for FAN_MARK_FILESYSTEM events
Date: Fri, 16 Nov 2018 08:51:17 +0200 [thread overview]
Message-ID: <20181116065119.6912-4-amir73il@gmail.com> (raw)
In-Reply-To: <20181116065119.6912-1-amir73il@gmail.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
testcases/kernel/syscalls/fanotify/fanotify.h | 3 +++
testcases/kernel/syscalls/fanotify/fanotify01.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index 5adef54d7..535f1cef2 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify.h
+++ b/testcases/kernel/syscalls/fanotify/fanotify.h
@@ -57,6 +57,9 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
#ifndef FAN_MARK_INODE
#define FAN_MARK_INODE 0
#endif
+#ifndef FAN_MARK_FILESYSTEM
+#define FAN_MARK_FILESYSTEM 0x00000100
+#endif
struct fanotify_mark_type {
unsigned int flag;
diff --git a/testcases/kernel/syscalls/fanotify/fanotify01.c b/testcases/kernel/syscalls/fanotify/fanotify01.c
index 5dfb67b61..c3d299474 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify01.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
@@ -44,6 +44,10 @@ static struct tcase {
"mount mark events",
INIT_FANOTIFY_MARK_TYPE(MOUNT),
},
+ {
+ "filesystem mark events",
+ INIT_FANOTIFY_MARK_TYPE(FILESYSTEM),
+ },
};
static char fname[BUF_SIZE];
@@ -68,6 +72,11 @@ static void test_fanotify(unsigned int n)
if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag,
FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN,
AT_FDCWD, fname) < 0) {
+ if (errno == EINVAL && mark->flag == FAN_MARK_FILESYSTEM) {
+ tst_res(TCONF,
+ "FAN_MARK_FILESYSTEM not supported in kernel?");
+ return;
+ }
tst_brk(TBROK | TERRNO,
"fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | %s | "
"FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "
--
2.17.1
next prev parent reply other threads:[~2018-11-16 6:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 6:51 [LTP] [PATCH 0/5] fanotify filesystem mark tests Amir Goldstein
2018-11-16 6:51 ` [LTP] [PATCH 1/5] syscalls/fanotify01: check events also on mountpoint mark Amir Goldstein
2018-11-21 12:01 ` Cyril Hrubis
2018-11-21 16:18 ` Amir Goldstein
2018-11-22 16:06 ` Cyril Hrubis
2018-11-22 16:57 ` Amir Goldstein
2018-11-16 6:51 ` [LTP] [PATCH 2/5] syscalls/fanotify03: check permission " Amir Goldstein
2018-11-21 12:26 ` Cyril Hrubis
2018-11-16 6:51 ` Amir Goldstein [this message]
2018-11-21 13:00 ` [LTP] [PATCH 3/5] syscalls/fanotify01: add test for FAN_MARK_FILESYSTEM events Cyril Hrubis
2018-11-16 6:51 ` [LTP] [PATCH 4/5] syscalls/fanotify03: add test for FAN_MARK_FILESYSTEM permission events Amir Goldstein
2018-11-21 13:14 ` Cyril Hrubis
2018-11-21 16:36 ` Amir Goldstein
2018-11-21 17:10 ` Amir Goldstein
2018-11-22 16:03 ` Cyril Hrubis
2018-11-16 6:51 ` [LTP] [PATCH 5/5] syscalls/fanotify10: add tests for FAN_MARK_FILESYSTEM and ignore mask Amir Goldstein
2018-11-21 13:27 ` Cyril Hrubis
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=20181116065119.6912-4-amir73il@gmail.com \
--to=amir73il@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox