These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / notify / fanotify / fanotify_user.c
index cf27550..8e8e6bc 100644 (file)
@@ -529,8 +529,10 @@ static int fanotify_remove_vfsmount_mark(struct fsnotify_group *group,
        removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags,
                                                 &destroy_mark);
        if (destroy_mark)
-               fsnotify_destroy_mark_locked(fsn_mark, group);
+               fsnotify_detach_mark(fsn_mark);
        mutex_unlock(&group->mark_mutex);
+       if (destroy_mark)
+               fsnotify_free_mark(fsn_mark);
 
        fsnotify_put_mark(fsn_mark);
        if (removed & real_mount(mnt)->mnt_fsnotify_mask)
@@ -557,8 +559,10 @@ static int fanotify_remove_inode_mark(struct fsnotify_group *group,
        removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags,
                                                 &destroy_mark);
        if (destroy_mark)
-               fsnotify_destroy_mark_locked(fsn_mark, group);
+               fsnotify_detach_mark(fsn_mark);
        mutex_unlock(&group->mark_mutex);
+       if (destroy_mark)
+               fsnotify_free_mark(fsn_mark);
 
        /* matches the fsnotify_find_inode_mark() */
        fsnotify_put_mark(fsn_mark);