linux-brain/fs/notify
Amir Goldstein 9bd5a84ceb fanotify: merge duplicate events on parent and child
[ Upstream commit f367a62a7cad2447d835a9f14fc63997a9137246 ]

With inotify, when a watch is set on a directory and on its child, an
event on the child is reported twice, once with wd of the parent watch
and once with wd of the child watch without the filename.

With fanotify, when a watch is set on a directory and on its child, an
event on the child is reported twice, but it has the exact same
information - either an open file descriptor of the child or an encoded
fid of the child.

The reason that the two identical events are not merged is because the
object id used for merging events in the queue is the child inode in one
event and parent inode in the other.

For events with path or dentry data, use the victim inode instead of the
watched inode as the object id for event merging, so that the event
reported on parent will be merged with the event reported on the child.

Link: https://lore.kernel.org/r/20200319151022.31456-9-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-14 07:58:30 +02:00
..
dnotify selinux/stable-5.4 PR 20190917 2019-09-23 11:21:04 -07:00
fanotify fanotify: merge duplicate events on parent and child 2020-05-14 07:58:30 +02:00
inotify fsnotify: replace inode pointer with an object id 2020-05-14 07:58:30 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fdinfo.c fsnotify/fdinfo: include fdinfo.h for inotify_show_fdinfo() 2018-11-15 17:34:27 +01:00
fdinfo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsnotify.c fs: call fsnotify_sb_delete after evict_inodes 2020-01-12 12:21:38 +01:00
fsnotify.h notify: export symbols for use by the knfsd file cache 2019-08-19 11:00:39 -04:00
group.c notify: export symbols for use by the knfsd file cache 2019-08-19 11:00:39 -04:00
mark.c notify: export symbols for use by the knfsd file cache 2019-08-19 11:00:39 -04:00
notification.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18 2019-05-21 11:28:46 +02:00