fsnotify: Fix detection whether overflow event is queued
authorJan Kara <jack@suse.cz>
Fri, 21 Feb 2014 18:02:34 +0000 (19:02 +0100)
committerJan Kara <jack@suse.cz>
Tue, 25 Feb 2014 10:17:52 +0000 (11:17 +0100)
Currently we didn't initialize event's list head when we removed it from
the event list. Thus a detection whether overflow event is already
queued wasn't working. Fix it by always initializing the list head when
deleting event from a list.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/notification.c

index 18b3c4427dcac0f2c9125581cc171be3f1eb3a9f..6bec2f4918f998c912517b9ed522b30af694357d 100644 (file)
@@ -132,7 +132,11 @@ struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group
 
        event = list_first_entry(&group->notification_list,
                                 struct fsnotify_event, list);
-       list_del(&event->list);
+       /*
+        * We need to init list head for the case of overflow event so that
+        * check in fsnotify_add_notify_events() works
+        */
+       list_del_init(&event->list);
        group->q_len--;
 
        return event;