Merge tag 'libnvdimm-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[deliverable/linux.git] / fs / notify / group.c
index d16b62cb28544a147183c3780e3a61ffa246c8bb..3e2dd85be5dd375a51af031566a381f20e46b21f 100644 (file)
@@ -47,12 +47,21 @@ static void fsnotify_final_destroy_group(struct fsnotify_group *group)
  */
 void fsnotify_destroy_group(struct fsnotify_group *group)
 {
-       /* clear all inode marks for this group */
-       fsnotify_clear_marks_by_group(group);
+       /* clear all inode marks for this group, attach them to destroy_list */
+       fsnotify_detach_group_marks(group);
 
-       synchronize_srcu(&fsnotify_mark_srcu);
+       /*
+        * Wait for fsnotify_mark_srcu period to end and free all marks in
+        * destroy_list
+        */
+       fsnotify_mark_destroy_list();
 
-       /* clear the notification queue of all events */
+       /*
+        * Since we have waited for fsnotify_mark_srcu in
+        * fsnotify_mark_destroy_list() there can be no outstanding event
+        * notification against this group. So clearing the notification queue
+        * of all events is reliable now.
+        */
        fsnotify_flush_notify(group);
 
        /*
This page took 0.025867 seconds and 5 git commands to generate.