Skip to contentSkip to conversation

fanotify: clarify mark type extraction

PATCH Superseded Fabian Frederick 2 participants 2 messages May 11, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 8/9 fanotify: clarify mark type extraction

mark type is resolved from flags but is not itself bitwise. That means user could send a combination and never note only one value was taken in consideration. This patch clarifies that fact in bit definitions.

Thanks to Amir for explanations.

---
 include/uapi/linux/fanotify.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/uapi/linux/fanotify.h +6 -1
index a88c7c6d0692..675bf6bbbe50 100644
@@ -71,7 +71,12 @@
 #define FAN_MARK_FLUSH		0x00000080
 /* FAN_MARK_FILESYSTEM is	0x00000100 */
 
-/* These are NOT bitwise flags.  Both bits can be used togther.  */
+/*
+ * These are NOT bitwise flags.  Both bits can be used together.
+ * IOW if someone does FAN_MARK_INODE | FAN_MARK_FILESYSTEM
+ * it will be considered FAN_MARK_FILESYSTEM and user won't be
+ * notified.
+ */
 #define FAN_MARK_INODE		0x00000000
 #define FAN_MARK_MOUNT		0x00000010
 #define FAN_MARK_FILESYSTEM	0x00000100
Signature · 1 line
2.26.2
#1 lore raw
Quoted 18 lines · Fabian Frederick

mark type is resolved from flags but is not itself bitwise. That means user could send a combination and never note only one value was taken in consideration. This patch clarifies that fact in bit definitions.

Thanks to Amir for explanations.

---
 include/uapi/linux/fanotify.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/uapi/linux/fanotify.h +0 -0
index a88c7c6d0692..675bf6bbbe50 100644

include/uapi/linux/fanotify.h line 78

Quoted 9 lines
include/uapi/linux/fanotify.h +5 -1
@@ -71,7 +71,12 @@
 #define FAN_MARK_FLUSH         0x00000080
 /* FAN_MARK_FILESYSTEM is      0x00000100 */
 
-/* These are NOT bitwise flags.  Both bits can be used togther.  */
+/*
+ * These are NOT bitwise flags.  Both bits can be used together.
+ * IOW if someone does FAN_MARK_INODE | FAN_MARK_FILESYSTEM
+ * it will be considered FAN_MARK_FILESYSTEM and user won't be
+ * notified.

Sorry, I don't find that those added lines add information. They are stating something obvious.
Especially, in uapi file, I rather not say anything at all then say confusing things.

Thanks,
Amir.

Quoted 7 lines
include/uapi/linux/fanotify.h +1 -1
+ */
 #define FAN_MARK_INODE         0x00000000
 #define FAN_MARK_MOUNT         0x00000010
 #define FAN_MARK_FILESYSTEM    0x00000100
--

2.26.2