fanotify: report parent fid + name + child fid
authorAmir Goldstein <amir73il@gmail.com>
Thu, 16 Jul 2020 08:42:29 +0000 (11:42 +0300)
committerJan Kara <jack@suse.cz>
Mon, 27 Jul 2020 21:24:00 +0000 (23:24 +0200)
commit7e8283af6edeb7dd9f8f18a429e6738c07f00ce4
treed4aea74ea2e9a6a23cc2913d9f7a4e46775d2bc8
parent929943b38daf817f2e6d303ea04401651fc3bc05
fanotify: report parent fid + name + child fid

For a group with fanotify_init() flag FAN_REPORT_DFID_NAME, the parent
fid and name are reported for events on non-directory objects with an
info record of type FAN_EVENT_INFO_TYPE_DFID_NAME.

If the group also has the init flag FAN_REPORT_FID, the child fid
is also reported with another info record that follows the first info
record. The second info record is the same info record that would have
been reported to a group with only FAN_REPORT_FID flag.

When the child fid needs to be recorded, the variable size struct
fanotify_name_event is preallocated with enough space to store the
child fh between the dir fh and the name.

Link: https://lore.kernel.org/r/20200716084230.30611-22-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c