fsnotify: Provide framework for dropping SRCU lock in ->handle_event
fanotify wants to drop fsnotify_mark_srcu lock when waiting for response from userspace so that the whole notification subsystem is not blocked during that time. This patch provides a framework for safely getting mark reference for a mark found in the object list which pins the mark in that list. We can then drop fsnotify_mark_srcu, wait for userspace response and then safely continue iteration of the object list once we reaquire fsnotify_mark_srcu. Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
此提交包含在:
@@ -126,6 +126,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
|
||||
/* set to 0 when there a no external references to this group */
|
||||
atomic_set(&group->refcnt, 1);
|
||||
atomic_set(&group->num_marks, 0);
|
||||
atomic_set(&group->user_waits, 0);
|
||||
|
||||
spin_lock_init(&group->notification_lock);
|
||||
INIT_LIST_HEAD(&group->notification_list);
|
||||
|
新增問題並參考
封鎖使用者