diff options
author | Amir Goldstein <amir73il@gmail.com> | 2019-01-10 19:04:28 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-02-06 15:11:59 +0100 |
commit | 5f02a877638472e83cb5e335f9eec27052b1c7c2 (patch) | |
tree | 3d11ee9837b4d4289373dd1e9d9a32b4eb96a9b5 /fs | |
parent | f17b5f06cb92ef2250513a1e154c47b78df07d40 (diff) |
fsnotify: annotate directory entry modification events
"dirent" events are referring to events that modify directory entries,
such as create,delete,rename. Those events should always be reported
on a watched directory, regardless if FS_EVENT_ON_CHILD is set
on the watch mask.
fsnotify_nameremove() and fsnotify_move() were modified to no longer
set the FS_EVENT_ON_CHILD event bit. This is a semantic change to
align with the "dirent" event definition. It has no effect on any
existing backend, because dnotify, inotify and audit always requets the
child events and fanotify does not get the delete,rename events.
The fsnotify_dirent() helper is used instead of fsnotify_parent() to
report a dirent event to dentry->d_parent without FS_EVENT_ON_CHILD
and regardless if parent has the FS_EVENT_ON_CHILD bit set.
Unlike fsnotify_parent(), fsnotify_dirent() assumes that dentry->d_name
and dentry->d_parent are stable. For fsnotify_create()/fsnotify_mkdir(),
this assumption is abviously correct. For fsnotify_nameremove(), it is
less trivial, so we use dget_parent() and take_dentry_name_snapshot() to
grab stable references.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions