fanotify: clarify mark type extraction
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
@@ -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
Amir Goldstein
reviewerQuoted 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.
Signed-off-by Fabian Frederick <[email protected]>--- include/uapi/linux/fanotify.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)include/uapi/linux/fanotify.h +0
-0
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