fanotify: Handle overflow in case of permission events

If the event queue overflows when we are handling permission event, we
will never get response from userspace. So we must avoid waiting for it.
Change fsnotify_add_notify_event() to return whether overflow has
happened so that we can detect it in fanotify_handle_event() and act
accordingly.

Signed-off-by: Jan Kara <jack@suse.cz>
Bu işleme şunda yer alıyor:
Jan Kara
2014-02-21 19:07:54 +01:00
ebeveyn 2513190a92
işleme 482ef06c5e
2 değiştirilmiş dosya ile 14 ekleme ve 6 silme

Dosyayı Görüntüle

@@ -192,10 +192,12 @@ static int fanotify_handle_event(struct fsnotify_group *group,
ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge);
if (ret) {
BUG_ON(mask & FAN_ALL_PERM_EVENTS);
/* Permission events shouldn't be merged */
BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS);
/* Our event wasn't used in the end. Free it. */
fsnotify_destroy_event(group, fsn_event);
ret = 0;
return 0;
}
#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS