summaryrefslogtreecommitdiffstats
path: root/fs/notify/mark.c
diff options
context:
space:
mode:
authorJan Kara2016-12-21 14:48:18 +0100
committerJan Kara2017-04-10 17:37:36 +0200
commitf09b04a03e0239f65bd964a1de758e53cf6349e8 (patch)
treedc8f9b75eb2f98fee22d48e516a3734035868c69 /fs/notify/mark.c
parentfsnotify: Detach mark from object list when last reference is dropped (diff)
downloadkernel-qcow2-linux-f09b04a03e0239f65bd964a1de758e53cf6349e8.tar.gz
kernel-qcow2-linux-f09b04a03e0239f65bd964a1de758e53cf6349e8.tar.xz
kernel-qcow2-linux-f09b04a03e0239f65bd964a1de758e53cf6349e8.zip
fsnotify: Remove special handling of mark destruction on group shutdown
Currently we queue all marks for destruction on group shutdown and then destroy them from fsnotify_destroy_group() instead from a worker thread which is the usual path. However worker can already be processing some list of marks to destroy so this does not make 100% all marks are really destroyed by the time group is shut down. This isn't a big problem as each mark holds group reference and thus group stays partially alive until all marks are really freed but there's no point in complicating our lives - just wait for the delayed work to be finished instead. 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/mark.c')
-rw-r--r--fs/notify/mark.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 21c7791362c8..f916b71c9139 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -703,7 +703,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
* Destroy all marks in destroy_list, waits for SRCU period to finish before
* actually freeing marks.
*/
-void fsnotify_mark_destroy_list(void)
+static void fsnotify_mark_destroy_workfn(struct work_struct *work)
{
struct fsnotify_mark *mark, *next;
struct list_head private_destroy_list;
@@ -721,7 +721,8 @@ void fsnotify_mark_destroy_list(void)
}
}
-static void fsnotify_mark_destroy_workfn(struct work_struct *work)
+/* Wait for all marks queued for destruction to be actually destroyed */
+void fsnotify_wait_marks_destroyed(void)
{
- fsnotify_mark_destroy_list();
+ flush_delayed_work(&reaper_work);
}