summaryrefslogtreecommitdiff
path: root/fs/notify/group.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-01-04 10:51:58 +0100
committerJan Kara <jack@suse.cz>2017-04-10 17:37:36 +0200
commit2e37c6ca8d76c362e844c0cf3ebe8ba2e27940cb (patch)
tree9149a5b0d36240b6c41d614a28cc6635e2570fc5 /fs/notify/group.c
parent18f2e0d3a43641889ac2ba9d7508d47359eec063 (diff)
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 <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/group.c')
-rw-r--r--fs/notify/group.c9
1 files changed, 8 insertions, 1 deletions
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