Skip to contentSkip to conversation

fanotify: Fix missing __kernel_fsid_t definition

PATCH New Petr Vorel 3 participants 4 messages Oct 16, 2019 – Oct 17, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 fanotify: Fix missing __kernel_fsid_t definition

which is missing at least on musl which doesn't have FAN_REPORT_FID support.

---
 testcases/kernel/syscalls/fanotify/fanotify.h | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/fanotify/fanotify.h +4 -0
index 1c7623d3b..01a2d52bd 100644
@@ -35,6 +35,10 @@
 #include <errno.h>
 #include <fcntl.h>
 
+#if !defined(FAN_REPORT_FID) && defined(HAVE_NAME_TO_HANDLE_AT)
+#include <asm/posix_types.h> // __kernel_fsid_t
+#endif
+
 #if defined(HAVE_SYS_FANOTIFY_H)
 
 #include <sys/fanotify.h>
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 fanotify: Fix missing __kernel_fsid_t definition

----- Original Message -----

Quoted 14 lines

which is missing at least on musl which doesn't have FAN_REPORT_FID support.

---
 testcases/kernel/syscalls/fanotify/fanotify.h | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/fanotify/fanotify.h +0 -0
index 1c7623d3b..01a2d52bd 100644

testcases/kernel/syscalls/fanotify/fanotify.h line 38

Quoted 4 lines
testcases/kernel/syscalls/fanotify/fanotify.h +1 -0
@@ -35,6 +35,10 @@
 #include <errno.h>
 #include <fcntl.h>
 
+#if !defined(FAN_REPORT_FID) && defined(HAVE_NAME_TO_HANDLE_AT)

Will FAN_REPORT_FID ever be defined at this point, when include of sys/fanotify.h is below?

Quoted 13 lines
testcases/kernel/syscalls/fanotify/fanotify.h +3 -1
+#include <asm/posix_types.h> // __kernel_fsid_t
+#endif
+
 #if defined(HAVE_SYS_FANOTIFY_H)
 
 #include <sys/fanotify.h>
--

2.23.0

--
Mailing list info: https://lists.linux.it/listinfo/ltp

#2 lore raw

PATCH 1/1 fanotify: Fix missing __kernel_fsid_t definition

In reply to Petr Vorel

----- Original Message -----

Quoted 14 lines

which is missing at least on musl which doesn't have FAN_REPORT_FID support.

---
 testcases/kernel/syscalls/fanotify/fanotify.h | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/fanotify/fanotify.h +0 -0
index 1c7623d3b..01a2d52bd 100644

testcases/kernel/syscalls/fanotify/fanotify.h line 40

Quoted 6 lines
testcases/kernel/syscalls/fanotify/fanotify.h +3 -0
@@ -35,6 +35,10 @@
 #include <errno.h>
 #include <fcntl.h>
 
+#if !defined(FAN_REPORT_FID) && defined(HAVE_NAME_TO_HANDLE_AT)
+#include <asm/posix_types.h> // __kernel_fsid_t
+#endif

Would an alternative that adds this type to lapi work? (just looking if we can avoid extra kernel include)

typedef struct {
        int     val[2];
} lapi_fsid_t;

#define __kernel_fsid_t lapi_fsid_t

#3 lore raw

PATCH 1/1 fanotify: Fix missing __kernel_fsid_t definition

Hi!

Quoted 7 lines

testcases/kernel/syscalls/fanotify/fanotify.h line 40

Quoted 3 lines
testcases/kernel/syscalls/fanotify/fanotify.h +3 -0
+#if !defined(FAN_REPORT_FID) && defined(HAVE_NAME_TO_HANDLE_AT)
+#include <asm/posix_types.h> // __kernel_fsid_t
+#endif

Would an alternative that adds this type to lapi work? (just looking if we can avoid extra kernel include)

Quoted 5 lines
typedef struct {
        int     val[2];
} lapi_fsid_t;

#define __kernel_fsid_t lapi_fsid_t

This looks a bit safer to me as well.

Signature · 2 lines
Cyril Hrubis
[email protected]