]> Pileus Git - ~andy/linux/blobdiff - fs/notify/fanotify/fanotify.c
fanotify: dont merge permission events
[~andy/linux] / fs / notify / fanotify / fanotify.c
index f35794b97e8e5cb5cc396af28206d69ca1202935..aeb5b5abbd4fcb9036b1b9e7391541c20d8b8d3c 100644 (file)
@@ -18,6 +18,12 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
            old->tgid == new->tgid) {
                switch (old->data_type) {
                case (FSNOTIFY_EVENT_PATH):
+#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+                       /* dont merge two permission events */
+                       if ((old->mask & FAN_ALL_PERM_EVENTS) &&
+                           (new->mask & FAN_ALL_PERM_EVENTS))
+                               return false;
+#endif
                        if ((old->path.mnt == new->path.mnt) &&
                            (old->path.dentry == new->path.dentry))
                                return true;