Skip to contentSkip to conversation

syscalls/fanotify10: new test for mount ignore mask

PATCH Superseded Amir Goldstein 1 participant 1 message Sep 23, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 syscalls/fanotify10: new test for mount ignore mask

This is a regression test for commit:
9bdda4e9cf2d fsnotify: fix ignore mask logic in fsnotify()

---
Cyril,

Following discussion with you and Richard, I decided to leave fanotify06 unchanged, because this new test is sufficiently different and also fails on old kernels.

I implemented the test with index and added 4 new test cases instead of just the one that checks the regression.

This test structure makes it easy to add coverage for to the upcoming filesystem mark type (see my fanotify_sb tests [1]).

Changes from v1:
- Use test index to iterate test cases

[1] https://github.com/amir73il/ltp/commits/fanotify_sb

 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore |   1 +
 testcases/kernel/syscalls/fanotify/fanotify.h |  12 +
 .../kernel/syscalls/fanotify/fanotify10.c     | 331 ++++++++++++++++++
 4 files changed, 345 insertions(+)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify10.c
runtest/syscalls +1 -0
index 0d0be7713..cd52561a5 100644
@@ -497,6 +497,7 @@ fanotify06 fanotify06
 fanotify07 fanotify07
 fanotify08 fanotify08
 fanotify09 fanotify09
+fanotify10 fanotify10
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index ec7553995..c26f2bd27 100644
@@ -7,3 +7,4 @@
 /fanotify07
 /fanotify08
 /fanotify09
+/fanotify10
testcases/kernel/syscalls/fanotify/fanotify.h +12 -0
index f5f7df25e..5adef54d7 100644
@@ -54,4 +54,16 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 
 #endif /* HAVE_SYS_FANOTIFY_H */
 
+#ifndef FAN_MARK_INODE
+#define FAN_MARK_INODE		0
+#endif
+
+struct fanotify_mark_type {
+	unsigned int flag;
+	const char * name;
+};
+
+#define INIT_FANOTIFY_MARK_TYPE(t) \
+	{ FAN_MARK_ ## t, "FAN_MARK_" #t }
+
 #endif /* __FANOTIFY_H__ */
testcases/kernel/syscalls/fanotify/fanotify10.c new file +331 -0

331 lines not on this page · raw message

Signature · 1 line
2.17.1