Skip to contentSkip to conversation

FAN_REPORT_FID and Directory Modification Events

PATCH Superseded Matthew Bobrowski 3 participants 9 messages Apr 20, 2019 – May 19, 2019

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover FAN_REPORT_FID and Directory Modification Events

This patch series contains the changes needed to support and validate the new FAN_REPORT_FID flag and directory modification event functionality within the fanotify API.

Changes since version 1:
* Added new line entries into runtest/syscalls to support newly defined fanotify tests.

* Defined new generic helper function within fanotify.h to remove code duplication that was previsouly found across tests.

* Added '.all_filesystems = 1' flag within tests fanotify14 and fanotify15.

Matthew Bobrowski (3):
syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality syscalls/fanotify14: new test to validate FAN_REPORT_FID interface
return values
syscalls/fanotify15: verify fid for dirent events

 runtest/syscalls                                |   3 +
 testcases/kernel/syscalls/fanotify/.gitignore   |   3 +
 testcases/kernel/syscalls/fanotify/fanotify.h   |  77 +++++-
 testcases/kernel/syscalls/fanotify/fanotify13.c | 313 ++++++++++++++++++++++++
 testcases/kernel/syscalls/fanotify/fanotify14.c | 171 +++++++++++++
 testcases/kernel/syscalls/fanotify/fanotify15.c | 245 +++++++++++++++++++
 6 files changed, 809 insertions(+), 3 deletions(-)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify13.c
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify14.c
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify15.c
Signature · 5 lines
1.8.3.1


-- 
Matthew Bobrowski
#1 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

Newly defined test file to validate the fanotify FAN_REPORT_FID functionality. A new line entry for this test file has been added within runtest/syscalls.

Additionally, defined a helper function that can be used to obtain __kernel_fsid_t and file_handle objects. This helper will be used by tests related to FAN_REPORT_FID.

---
 runtest/syscalls                                |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore   |   1 +
 testcases/kernel/syscalls/fanotify/fanotify.h   |  52 +++-
 testcases/kernel/syscalls/fanotify/fanotify13.c | 313 ++++++++++++++++++++++++
 4 files changed, 364 insertions(+), 3 deletions(-)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify13.c
runtest/syscalls +1 -0
index 2b8ca71..dfdc6cb 100644
@@ -537,6 +537,7 @@ fanotify09 fanotify09
 fanotify10 fanotify10
 fanotify11 fanotify11
 fanotify12 fanotify12
+fanotify13 fanotify13
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index 4256b8c..16bdd99 100644
@@ -10,4 +10,5 @@
 /fanotify10
 /fanotify11
 /fanotify12
+/fanotify13
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify.h +49 -3

70 lines not on this page · raw message

testcases/kernel/syscalls/fanotify/fanotify13.c new file +313 -0

313 lines not on this page · raw message

Signature · 5 lines
1.8.3.1


-- 
Matthew Bobrowski
#2 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

Hi!
I've tried these tests on buildservice to check that there are no problems on slightly older distributions and found two.

The first one is that we do define fallback definitions in fanotify.h but then ifdef the whole test code in #if defined(HAVE_SYS_FANOTIFY_H) so that it's efectively disabled on older distros even with fallback definitions in place. Also it's TST_TEST_TCONF() but that is just easy to fix typo. I guess that we can remove the ifdef and sys/fanotify.h include from the test sources since we conditionally include the sys/fanotify.h in the local fanotify.h already.

The second one is that we fail to compile on older distributions because of missing name_to_handle_at() so we need configure check for that syscall and fallback definition in lapi/ header, or at least configure check and ifdef in the fanotify_get_fid() function. Which should be as easy as adding a name_to_handle_at line to AC_CHECK_FUNCS() in the configure.ac and using the macro from config.h.

Quoted 78 lines
runtest/syscalls +1 -0
index 2b8ca71..dfdc6cb 100644
@@ -537,6 +537,7 @@ fanotify09 fanotify09
 fanotify10 fanotify10
 fanotify11 fanotify11
 fanotify12 fanotify12
+fanotify13 fanotify13
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index 4256b8c..16bdd99 100644
@@ -10,4 +10,5 @@
 /fanotify10
 /fanotify11
 /fanotify12
+/fanotify13
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify.h +31 -3
index 14654b7..e9b23cc 100644
@@ -29,6 +29,11 @@
 #define	__FANOTIFY_H__
 
 #include "config.h"
+#include <sys/statfs.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 
@@ -57,9 +62,6 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 #ifndef FAN_REPORT_TID
 #define FAN_REPORT_TID		0x00000100
 #endif
-#ifndef FAN_REPORT_FID
-#define FAN_REPORT_FID		0x00000200
-#endif
 
 #ifndef FAN_MARK_INODE
 #define FAN_MARK_INODE		0
@@ -89,6 +91,50 @@ struct fanotify_mark_type {
 	const char * name;
 };
 
+#ifndef FAN_REPORT_FID
+#define FAN_REPORT_FID		0x00000200
+
+struct fanotify_event_info_header {
+	uint8_t info_type;
+	uint8_t pad;
+	uint16_t len;
+};
+
+struct fanotify_event_info_fid {
+	struct fanotify_event_info_header hdr;
+	__kernel_fsid_t fsid;
+	unsigned char handle[0];
+};
+
+/*
+ * Helper function used to obtain __kernel_fsid_t and file_handle objects
+ * for a given path. Used by test files correlated to FAN_REPORT_FID
+ * functionality.
+ */
+static inline void fanotify_get_fid(const char *path, __kernel_fsid_t *fsid,
+			struct file_handle *handle)
+{
+	int mount_id;
+	struct statfs stats;
+

testcases/kernel/syscalls/fanotify/fanotify.h struct fanotify_mark_type { · line 129

Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify.h +10 -0
+	if (statfs(path, &stats) == -1)
+		tst_brk(TBROK | TERRNO,
+			"statfs(%s, ...) failed", path);
+	memcpy(fsid, &stats.f_fsid, sizeof(stats.f_fsid));
+
+	if (name_to_handle_at(AT_FDCWD, path, handle, &mount_id, 0) == -1) {
+		if (errno == EOPNOTSUPP) {
+			tst_res(TCONF,
+				"filesystem %s does not support file handles",
+				tst_device->fs_type);

Btw, here the tst_res() does not make much sense sice the code will continue and we will exit the test with the tst_brk() below. Shouldn't we use tst_brk() here as well?

Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify.h +8 -0
+		}
+		tst_brk(TBROK | TERRNO,
+			"name_to_handle_at(AT_FDCWD, %s, ...) failed", path);
+	}
+}
+
+#endif
+
 #define INIT_FANOTIFY_MARK_TYPE(t) \
 	{ FAN_MARK_ ## t, "FAN_MARK_" #t }
Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

Quoted 11 lines · Cyril Hrubis

Hi!
I've tried these tests on buildservice to check that there are no problems on slightly older distributions and found two.

The first one is that we do define fallback definitions in fanotify.h but then ifdef the whole test code in #if defined(HAVE_SYS_FANOTIFY_H) so that it's efectively disabled on older distros even with fallback definitions in place. Also it's TST_TEST_TCONF() but that is just easy to fix typo. I guess that we can remove the ifdef and sys/fanotify.h include from the test sources since we conditionally include the sys/fanotify.h in the local fanotify.h already.

OK. In that case I can write a patch that is to be applied prior to this series which essentially just removes this specific preprocessor conditional directive from all the source files. Would you like me to do this?

Quoted 6 lines

The second one is that we fail to compile on older distributions because of missing name_to_handle_at() so we need configure check for that syscall and fallback definition in lapi/ header, or at least configure check and ifdef in the fanotify_get_fid() function. Which should be as easy as adding a name_to_handle_at line to AC_CHECK_FUNCS() in the configure.ac and using the macro from config.h.

Sure. I've gone ahead an updated it to accommodate for this. Prior to submitting through another patches series, changes can be found here:
https://github.com/matthewbobrowski/ltp/commit/54264db0e574d2f90e716a510fcb1da11ee174dc.

I think we can do better and also provide a fallback definition though, thoughts? Don't believe that it would take much effort.

Quoted 84 lines
Quoted 84 lines
runtest/syscalls +1 -0
index 2b8ca71..dfdc6cb 100644
@@ -537,6 +537,7 @@ fanotify09 fanotify09
 fanotify10 fanotify10
 fanotify11 fanotify11
 fanotify12 fanotify12
+fanotify13 fanotify13
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index 4256b8c..16bdd99 100644
@@ -10,4 +10,5 @@
 /fanotify10
 /fanotify11
 /fanotify12
+/fanotify13
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify.h +37 -3
index 14654b7..e9b23cc 100644
@@ -29,6 +29,11 @@
 #define	__FANOTIFY_H__
 
 #include "config.h"
+#include <sys/statfs.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 
@@ -57,9 +62,6 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 #ifndef FAN_REPORT_TID
 #define FAN_REPORT_TID		0x00000100
 #endif
-#ifndef FAN_REPORT_FID
-#define FAN_REPORT_FID		0x00000200
-#endif
 
 #ifndef FAN_MARK_INODE
 #define FAN_MARK_INODE		0
@@ -89,6 +91,50 @@ struct fanotify_mark_type {
 	const char * name;
 };
 
+#ifndef FAN_REPORT_FID
+#define FAN_REPORT_FID		0x00000200
+
+struct fanotify_event_info_header {
+	uint8_t info_type;
+	uint8_t pad;
+	uint16_t len;
+};
+
+struct fanotify_event_info_fid {
+	struct fanotify_event_info_header hdr;
+	__kernel_fsid_t fsid;
+	unsigned char handle[0];
+};
+
+/*
+ * Helper function used to obtain __kernel_fsid_t and file_handle objects
+ * for a given path. Used by test files correlated to FAN_REPORT_FID
+ * functionality.
+ */
+static inline void fanotify_get_fid(const char *path, __kernel_fsid_t *fsid,
+			struct file_handle *handle)
+{
+	int mount_id;
+	struct statfs stats;
+
+	if (statfs(path, &stats) == -1)
+		tst_brk(TBROK | TERRNO,
+			"statfs(%s, ...) failed", path);
+	memcpy(fsid, &stats.f_fsid, sizeof(stats.f_fsid));
+
+	if (name_to_handle_at(AT_FDCWD, path, handle, &mount_id, 0) == -1) {
Quoted 8 lines

testcases/kernel/syscalls/fanotify/fanotify.h struct fanotify_mark_type { · line 129

Quoted 4 lines
testcases/kernel/syscalls/fanotify/fanotify.h +4 -0
+		if (errno == EOPNOTSUPP) {
+			tst_res(TCONF,
+				"filesystem %s does not support file handles",
+				tst_device->fs_type);

Btw, here the tst_res() does not make much sense sice the code will continue and we will exit the test with the tst_brk() below. Shouldn't we use tst_brk() here as well?

Yes, we should be using tst_brk(...) instead. Thanks for picking this up.

Quoted 10 lines
Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify.h +8 -0
+		}
+		tst_brk(TBROK | TERRNO,
+			"name_to_handle_at(AT_FDCWD, %s, ...) failed", path);
+	}
+}
+
+#endif
+
 #define INIT_FANOTIFY_MARK_TYPE(t) \
 	{ FAN_MARK_ ## t, "FAN_MARK_" #t }
Signature · 1 line
Matthew Bobrowski
#4 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

Hi Cyril,

Any feedback on the below?

Quoted 136 lines · Matthew Bobrowski
Quoted 11 lines · Cyril Hrubis

Hi!
I've tried these tests on buildservice to check that there are no problems on slightly older distributions and found two.

The first one is that we do define fallback definitions in fanotify.h but then ifdef the whole test code in #if defined(HAVE_SYS_FANOTIFY_H) so that it's efectively disabled on older distros even with fallback definitions in place. Also it's TST_TEST_TCONF() but that is just easy to fix typo. I guess that we can remove the ifdef and sys/fanotify.h include from the test sources since we conditionally include the sys/fanotify.h in the local fanotify.h already.

OK. In that case I can write a patch that is to be applied prior to this series which essentially just removes this specific preprocessor conditional directive from all the source files. Would you like me to do this?

Quoted 6 lines

The second one is that we fail to compile on older distributions because of missing name_to_handle_at() so we need configure check for that syscall and fallback definition in lapi/ header, or at least configure check and ifdef in the fanotify_get_fid() function. Which should be as easy as adding a name_to_handle_at line to AC_CHECK_FUNCS() in the configure.ac and using the macro from config.h.

Sure. I've gone ahead an updated it to accommodate for this. Prior to submitting through another patches series, changes can be found here:
https://github.com/matthewbobrowski/ltp/commit/54264db0e574d2f90e716a510fcb1da11ee174dc.

I think we can do better and also provide a fallback definition though, thoughts? Don't believe that it would take much effort.

Quoted 84 lines
Quoted 84 lines
runtest/syscalls +1 -0
index 2b8ca71..dfdc6cb 100644
@@ -537,6 +537,7 @@ fanotify09 fanotify09
 fanotify10 fanotify10
 fanotify11 fanotify11
 fanotify12 fanotify12
+fanotify13 fanotify13
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index 4256b8c..16bdd99 100644
@@ -10,4 +10,5 @@
 /fanotify10
 /fanotify11
 /fanotify12
+/fanotify13
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify.h +37 -3
index 14654b7..e9b23cc 100644
@@ -29,6 +29,11 @@
 #define	__FANOTIFY_H__
 
 #include "config.h"
+#include <sys/statfs.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 
@@ -57,9 +62,6 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 #ifndef FAN_REPORT_TID
 #define FAN_REPORT_TID		0x00000100
 #endif
-#ifndef FAN_REPORT_FID
-#define FAN_REPORT_FID		0x00000200
-#endif
 
 #ifndef FAN_MARK_INODE
 #define FAN_MARK_INODE		0
@@ -89,6 +91,50 @@ struct fanotify_mark_type {
 	const char * name;
 };
 
+#ifndef FAN_REPORT_FID
+#define FAN_REPORT_FID		0x00000200
+
+struct fanotify_event_info_header {
+	uint8_t info_type;
+	uint8_t pad;
+	uint16_t len;
+};
+
+struct fanotify_event_info_fid {
+	struct fanotify_event_info_header hdr;
+	__kernel_fsid_t fsid;
+	unsigned char handle[0];
+};
+
+/*
+ * Helper function used to obtain __kernel_fsid_t and file_handle objects
+ * for a given path. Used by test files correlated to FAN_REPORT_FID
+ * functionality.
+ */
+static inline void fanotify_get_fid(const char *path, __kernel_fsid_t *fsid,
+			struct file_handle *handle)
+{
+	int mount_id;
+	struct statfs stats;
+
+	if (statfs(path, &stats) == -1)
+		tst_brk(TBROK | TERRNO,
+			"statfs(%s, ...) failed", path);
+	memcpy(fsid, &stats.f_fsid, sizeof(stats.f_fsid));
+
+	if (name_to_handle_at(AT_FDCWD, path, handle, &mount_id, 0) == -1) {
Quoted 8 lines

testcases/kernel/syscalls/fanotify/fanotify.h struct fanotify_mark_type { · line 129

Quoted 4 lines
testcases/kernel/syscalls/fanotify/fanotify.h +4 -0
+		if (errno == EOPNOTSUPP) {
+			tst_res(TCONF,
+				"filesystem %s does not support file handles",
+				tst_device->fs_type);

Btw, here the tst_res() does not make much sense sice the code will continue and we will exit the test with the tst_brk() below. Shouldn't we use tst_brk() here as well?

Yes, we should be using tst_brk(...) instead. Thanks for picking this up.

Quoted 10 lines
Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify.h +8 -0
+		}
+		tst_brk(TBROK | TERRNO,
+			"name_to_handle_at(AT_FDCWD, %s, ...) failed", path);
+	}
+}
+
+#endif
+
 #define INIT_FANOTIFY_MARK_TYPE(t) \
 	{ FAN_MARK_ ## t, "FAN_MARK_" #t }
Signature · 1 line
Matthew Bobrowski
#5 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

In reply to Matthew Bobrowski
Quoted 14 lines · Matthew Bobrowski
Quoted 11 lines · Cyril Hrubis

Hi!
I've tried these tests on buildservice to check that there are no problems on slightly older distributions and found two.

The first one is that we do define fallback definitions in fanotify.h but then ifdef the whole test code in #if defined(HAVE_SYS_FANOTIFY_H) so that it's efectively disabled on older distros even with fallback definitions in place. Also it's TST_TEST_TCONF() but that is just easy to fix typo. I guess that we can remove the ifdef and sys/fanotify.h include from the test sources since we conditionally include the sys/fanotify.h in the local fanotify.h already.

Quoted 3 lines

OK. In that case I can write a patch that is to be applied prior to this series which essentially just removes this specific preprocessor conditional directive from all the source files. Would you like me to do this?

If I understand the concern correctly, it is not really important to address now for these new tests that check functionality only available since kernel v5.1. It could be addressed by followup work.

Quoted 8 lines
Quoted 7 lines

The second one is that we fail to compile on older distributions because of missing name_to_handle_at() so we need configure check for that syscall and fallback definition in lapi/ header, or at least configure check and ifdef in the fanotify_get_fid() function. Which should be as easy as adding a name_to_handle_at line to AC_CHECK_FUNCS() in the configure.ac and using the macro from config.h.

Quoted 7 lines

Sure. I've gone ahead an updated it to accommodate for this. Prior to submitting through another patches series, changes can be found here:
https://github.com/matthewbobrowski/ltp/commit/54264db0e574d2f90e716a510fcb1da11ee174dc.

I think we can do better and also provide a fallback definition though, thoughts? Don't believe that it would take much effort.

No reason to do that. Those tests will only be supported on kernel >= v5.1 old distros are less interesting for these tests.

Please post the patches for fanotify_dirent_3 branch.

Thanks,
Amir.

#6 lore raw

PATCH v2 1/3 syscalls/fanotify13: new test to verify FAN_REPORT_FID functionality

Quoted 13 lines · Amir Goldstein
Quoted 13 lines · Cyril Hrubis
Quoted 11 lines

Hi!
I've tried these tests on buildservice to check that there are no problems on slightly older distributions and found two.

The first one is that we do define fallback definitions in fanotify.h but then ifdef the whole test code in #if defined(HAVE_SYS_FANOTIFY_H) so that it's efectively disabled on older distros even with fallback definitions in place. Also it's TST_TEST_TCONF() but that is just easy to fix typo. I guess that we can remove the ifdef and sys/fanotify.h include from the test sources since we conditionally include the sys/fanotify.h in the local fanotify.h already.

Quoted 7 lines
Quoted 3 lines

OK. In that case I can write a patch that is to be applied prior to this series which essentially just removes this specific preprocessor conditional directive from all the source files. Would you like me to do this?

If I understand the concern correctly, it is not really important to address now for these new tests that check functionality only available since kernel v5.1. It could be addressed by followup work.

OK, no problem, this is fine with me.

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

The second one is that we fail to compile on older distributions because of missing name_to_handle_at() so we need configure check for that syscall and fallback definition in lapi/ header, or at least configure check and ifdef in the fanotify_get_fid() function. Which should be as easy as adding a name_to_handle_at line to AC_CHECK_FUNCS() in the configure.ac and using the macro from config.h.

Sure. I've gone ahead an updated it to accommodate for this. Prior to submitting through another patches series, changes can be found here:
https://github.com/matthewbobrowski/ltp/commit/54264db0e574d2f90e716a510fcb1da11ee174dc.

Quoted 7 lines
Quoted 2 lines

I think we can do better and also provide a fallback definition though, thoughts? Don't believe that it would take much effort.

No reason to do that. Those tests will only be supported on kernel >= v5.1 old distros are less interesting for these tests.

Please post the patches for fanotify_dirent_3 branch.

OK. I've rebased fanotify_dirent_3 of upstream/master and resubmitting the patch series now.

Signature · 1 line
Matthew Bobrowski
#7 lore raw

PATCH v2 2/3 syscalls/fanotify14: new test to validate FAN_REPORT_FID interface return values

In reply to Matthew Bobrowski

New test file has been introduced to validate that the fanotify interface returns the correct error values upon specifying invalid flags and masks in conjunction with FAN_REPORT_FID. A new line entry within runtest/syscalls for this new test file.

---
 runtest/syscalls                                |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore   |   1 +
 testcases/kernel/syscalls/fanotify/fanotify.h   |  25 ++++
 testcases/kernel/syscalls/fanotify/fanotify14.c | 171 ++++++++++++++++++++++++
 4 files changed, 198 insertions(+)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify14.c
runtest/syscalls +1 -0
index dfdc6cb..5c62895 100644
@@ -538,6 +538,7 @@ fanotify10 fanotify10
 fanotify11 fanotify11
 fanotify12 fanotify12
 fanotify13 fanotify13
+fanotify14 fanotify14
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index 16bdd99..bf389c9 100644
@@ -11,4 +11,5 @@
 /fanotify11
 /fanotify12
 /fanotify13
+/fanotify14
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify.h +25 -0
index e9b23cc..7c88fa8 100644
@@ -69,6 +69,31 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 #ifndef FAN_MARK_FILESYSTEM
 #define FAN_MARK_FILESYSTEM	0x00000100
 #endif
+/* New dirent event masks */
+#ifndef FAN_ATTRIB
+#define FAN_ATTRIB		0x00000004
+#endif
+#ifndef FAN_MOVED_FROM
+#define FAN_MOVED_FROM		0x00000040
+#endif
+#ifndef FAN_MOVED_TO
+#define FAN_MOVED_TO		0x00000080
+#endif
+#ifndef FAN_CREATE
+#define FAN_CREATE		0x00000100
+#endif
+#ifndef FAN_DELETE
+#define FAN_DELETE		0x00000200
+#endif
+#ifndef FAN_DELETE_SELF
+#define FAN_DELETE_SELF		0x00000400
+#endif
+#ifndef FAN_MOVE_SELF
+#define FAN_MOVE_SELF		0x00000800
+#endif
+#ifndef FAN_MOVE
+#define FAN_MOVE		(FAN_MOVED_FROM | FAN_MOVED_TO)
+#endif
 #ifndef FAN_OPEN_EXEC
 #define FAN_OPEN_EXEC		0x00001000
 #endif
testcases/kernel/syscalls/fanotify/fanotify14.c new file +171 -0

171 lines not on this page · raw message

Signature · 5 lines
1.8.3.1


-- 
Matthew Bobrowski
#8 lore raw

PATCH v2 3/3 syscalls/fanotify15: verify fid for dirent events

In reply to Matthew Bobrowski

New test file that provides coverage for new dirent events. A new line entry within the runtest/syscalls file has been added to support this new test file.

---
 runtest/syscalls                                |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore   |   1 +
 testcases/kernel/syscalls/fanotify/fanotify15.c | 245 ++++++++++++++++++++++++
 3 files changed, 247 insertions(+)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify15.c
runtest/syscalls +1 -0
index 5c62895..2f9f147 100644
@@ -539,6 +539,7 @@ fanotify11 fanotify11
 fanotify12 fanotify12
 fanotify13 fanotify13
 fanotify14 fanotify14
+fanotify15 fanotify15
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index bf389c9..68e4cc7 100644
@@ -12,4 +12,5 @@
 /fanotify12
 /fanotify13
 /fanotify14
+/fanotify15
 /fanotify_child
testcases/kernel/syscalls/fanotify/fanotify15.c new file +245 -0

245 lines not on this page · raw message

Signature · 5 lines
1.8.3.1


-- 
Matthew Bobrowski