fsnotify: add object type "child" to object type iterator
authorAmir Goldstein <amir73il@gmail.com>
Thu, 16 Jul 2020 08:42:16 +0000 (11:42 +0300)
committerJan Kara <jack@suse.cz>
Mon, 27 Jul 2020 19:23:37 +0000 (21:23 +0200)
commit6ba8d7107f27c1bde60a80bc5def027979af3e8e
tree0475f1a88c0296bea286fb6c666ff11d678d91fa
parent85af5d9258cc5862167c578c63c65ac700a3fa19
fsnotify: add object type "child" to object type iterator

The object type iterator is used to collect all the marks of
a specific group that have interest in an event.

It is used by fanotify to get a single handle_event callback
when an event has a match to either of inode/sb/mount marks
of the group.

The nature of fsnotify events is that they are associated with
at most one sb at most one mount and at most one inode.

When a parent and child are both watching, two events are sent
to backend, one associated to parent inode and one associated
to the child inode.

This results in duplicate events in fanotify, which usually
get merged before user reads them, but this is sub-optimal.

It would be better if the same event is sent to backend with
an object type iterator that has both the child inode and its
parent, and let the backend decide if the event should be reported
once (fanotify) or twice (inotify).

Link: https://lore.kernel.org/r/20200716084230.30611-9-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
include/linux/fsnotify_backend.h