From d6f18fa49b6998fe1ef29972c66c19a1ca7113c2 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 9 Jan 2017 20:19:12 +0300 Subject: [PATCH] zdtm/fanotify00: fix fanotify_{init, mark} calls O_* flags should be in event_f_flags parameter, according to fanotify_init(2). On x86_32 fanotify_mark() has second mask argument (as mask is 64-bit, the higher parts of mask shouldn't be used): > COMPAT_SYSCALL_DEFINE6(fanotify_mark, > int, fanotify_fd, unsigned int, flags, > __u32, mask0, __u32, mask1, int, dfd, > const char __user *, pathname) > { > return sys_fanotify_mark(fanotify_fd, flags, > #ifdef __BIG_ENDIAN > ((__u64)mask0 << 32) | mask1, > #else > ((__u64)mask1 << 32) | mask0, > #endif > dfd, pathname); travis-ci: success for 32-bit tests fixes Signed-off-by: Dmitry Safonov Signed-off-by: Pavel Emelyanov --- test/zdtm/static/fanotify00.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/zdtm/static/fanotify00.c b/test/zdtm/static/fanotify00.c index 1172145fe..3084e1850 100644 --- a/test/zdtm/static/fanotify00.c +++ b/test/zdtm/static/fanotify00.c @@ -75,7 +75,11 @@ static int fanotify_init(unsigned int flags, unsigned int event_f_flags) static int fanotify_mark(int fanotify_fd, unsigned int flags, unsigned long mask, int dfd, const char *pathname) { +#ifdef __i386__ + return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, 0, dfd, pathname); +#else return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname); +#endif } #define fdinfo_field(str, field) !strncmp(str, field":", sizeof(field)) @@ -226,9 +230,8 @@ int main (int argc, char *argv[]) } } - fa_fd = fanotify_init(FAN_NONBLOCK | O_RDONLY | O_LARGEFILE | - FAN_CLASS_NOTIF | FAN_UNLIMITED_QUEUE, - 0); + fa_fd = fanotify_init(FAN_NONBLOCK | FAN_CLASS_NOTIF | FAN_UNLIMITED_QUEUE, + O_RDONLY | O_LARGEFILE); if (fa_fd < 0) { pr_perror("fanotify_init failed"); exit(1);