fsnotify: Let userspace know about lost events due to ENOMEM
authorJan Kara <jack@suse.cz>
Wed, 21 Feb 2018 14:07:52 +0000 (15:07 +0100)
committerJan Kara <jack@suse.cz>
Tue, 27 Feb 2018 09:25:33 +0000 (10:25 +0100)
commit7b1f641776e0c8b824fb10135168e4b683a9e2ba
tree80f394d89521008b6bcbc980e202d25d7f35973f
parent1f5eaa90010ed7cf0ae90a526c48657d02c6086f
fsnotify: Let userspace know about lost events due to ENOMEM

Currently if notification event is lost due to event allocation failing
we ENOMEM, we just silently continue (except for fanotify permission
events where we deny the access). This is undesirable as userspace has
no way of knowing whether the notifications it got are complete or not.
Treat lost events due to ENOMEM the same way as lost events due to queue
overflow so that userspace knows something bad happened and it likely
needs to rescan the filesystem.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.c
fs/notify/inotify/inotify_fsnotify.c
fs/notify/notification.c
include/linux/fsnotify_backend.h