summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2010-08-18 12:25:50 -0400
committerEric Paris <eparis@redhat.com>2010-08-22 20:28:16 -0400
commit2eebf582c9b3106abb9c33f4fc0a347fb9391037 (patch)
tree0fab23d7e456713815890fc01a148132b9b857f8 /include
parent84e1ab4d875922c034db7f4f814ac445a20a14bd (diff)
downloadlinux-3.10-2eebf582c9b3106abb9c33f4fc0a347fb9391037.tar.gz
linux-3.10-2eebf582c9b3106abb9c33f4fc0a347fb9391037.tar.bz2
linux-3.10-2eebf582c9b3106abb9c33f4fc0a347fb9391037.zip
fanotify: flush outstanding perm requests on group destroy
When an fanotify listener is closing it may cause a deadlock between the listener and the original task doing an fs operation. If the original task is waiting for a permissions response it will be holding the srcu lock. The listener cannot clean up and exit until after that srcu lock is syncronized. Thus deadlock. The fix introduced here is to stop accepting new permissions events when a listener is shutting down and to grant permission for all outstanding events. Thus the original task will eventually release the srcu lock and the listener can complete shutdown. Reported-by: Andreas Gruenbacher <agruen@suse.de> Cc: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fanotify.h7
-rw-r--r--include/linux/fsnotify_backend.h1
2 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index f0949a57ca9..985435622ec 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -95,11 +95,4 @@ struct fanotify_response {
(long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
(long)(meta)->event_len <= (long)(len))
-#ifdef __KERNEL__
-
-struct fanotify_wait {
- struct fsnotify_event *event;
- __s32 fd;
-};
-#endif /* __KERNEL__ */
#endif /* _LINUX_FANOTIFY_H */
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index ed36fb57c42..e40190d1687 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -156,6 +156,7 @@ struct fsnotify_group {
struct mutex access_mutex;
struct list_head access_list;
wait_queue_head_t access_waitq;
+ bool bypass_perm; /* protected by access_mutex */
#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */
int f_flags;
} fanotify_data;