aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/fanotify/fanotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/fanotify/fanotify.c')
-rw-r--r--fs/notify/fanotify/fanotify.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index 0e792f5e3147..dc638f786d5c 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -147,7 +147,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
147 struct fsnotify_mark *inode_mark, 147 struct fsnotify_mark *inode_mark,
148 struct fsnotify_mark *fanotify_mark, 148 struct fsnotify_mark *fanotify_mark,
149 u32 mask, void *data, int data_type, 149 u32 mask, void *data, int data_type,
150 const unsigned char *file_name) 150 const unsigned char *file_name, u32 cookie)
151{ 151{
152 int ret = 0; 152 int ret = 0;
153 struct fanotify_event_info *event; 153 struct fanotify_event_info *event;
@@ -192,10 +192,12 @@ static int fanotify_handle_event(struct fsnotify_group *group,
192 192
193 ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge); 193 ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge);
194 if (ret) { 194 if (ret) {
195 BUG_ON(mask & FAN_ALL_PERM_EVENTS); 195 /* Permission events shouldn't be merged */
196 BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS);
196 /* Our event wasn't used in the end. Free it. */ 197 /* Our event wasn't used in the end. Free it. */
197 fsnotify_destroy_event(group, fsn_event); 198 fsnotify_destroy_event(group, fsn_event);
198 ret = 0; 199
200 return 0;
199 } 201 }
200 202
201#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS 203#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS