From 2e37c6ca8d76c362e844c0cf3ebe8ba2e27940cb Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 4 Jan 2017 10:51:58 +0100 Subject: fsnotify: Remove fsnotify_detach_group_marks() The function is already mostly contained in what fsnotify_clear_marks_by_group() does. Just update that function to not select marks when all of them should be destroyed and remove fsnotify_detach_group_marks(). Reviewed-by: Miklos Szeredi Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/group.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'fs/notify/group.c') diff --git a/fs/notify/group.c b/fs/notify/group.c index 79439cdf16e0..32357534de18 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -67,7 +67,14 @@ void fsnotify_destroy_group(struct fsnotify_group *group) fsnotify_group_stop_queueing(group); /* Clear all marks for this group and queue them for destruction */ - fsnotify_detach_group_marks(group); + fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_ALL_TYPES); + + /* + * Some marks can still be pinned when waiting for response from + * userspace. Wait for those now. fsnotify_prepare_user_wait() will + * not succeed now so this wait is race-free. + */ + wait_event(group->notification_waitq, !atomic_read(&group->user_waits)); /* * Wait until all marks get really destroyed. We could actually destroy -- cgit v1.2.3