inotify: fix inotify oneshot support
Subsystems (2)
PATCH 1/2 inotify: fix inotify oneshot support
During the large inotify rewrite to fsnotify I completely dropped support for IN_ONESHOT. Reimplement that support.
Signed-off-by Eric Paris <[email protected]>
---
fs/notify/inotify/inotify_fsnotify.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
fs/notify/inotify/inotify_fsnotify.c +3 -0
@@ -126,6 +126,9 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev ret =0 ; } +if (fsn_mark->mask &IN_ONESHOT ) +fsnotify_destroy_mark (fsn_mark); +/* * If we hold the fsn_mark until after the event is on the queue * IN_IGNORED won't be able to pass this event in the queue
PATCH 2/2 inotify: send IN_UNMOUNT events
Since the .31 or so notify rewrite inotify has not sent events about inodes which are unmounted. This patch restores those events.
Signed-off-by Eric Paris <[email protected]>
---
fs/notify/inotify/inotify_user.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
fs/notify/inotify/inotify_user.c +5 -2
@@ -90,8 +90,11 @@ static inline __u32 inotify_arg_to_mask(u32 arg) {__u32 mask; -/* everything should accept their own ignored and cares about children */ - mask = (FS_IN_IGNORED |FS_EVENT_ON_CHILD ); +/* +* everything should accept their own ignored, cares about children, +* and should receive events when the inode is unmounted +*/ + mask = (FS_IN_IGNORED |FS_EVENT_ON_CHILD |FS_UNMOUNT );/* mask off the flags used to open the fd */ mask |= (arg & (IN_ALL_EVENTS |IN_ONESHOT ));