aboutsummaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorJan Kara <[email protected]>2016-10-07 16:56:49 -0700
committerLinus Torvalds <[email protected]>2016-10-07 18:46:26 -0700
commit1404ff3cc3a14cb1fe8535e30b87d20da9513767 (patch)
treeb9cd46c15ce1cba5f29607455bdb8439bf242273 /lib/memory-notifier-error-inject.c
parent87840a2b7e048018d18d60bdac5c09224de85370 (diff)
fsnotify: drop notification_mutex before destroying event
fsnotify_flush_notify() and fanotify_release() destroy notification event while holding notification_mutex. The destruction of fanotify event includes a path_put() call which may end up calling into a filesystem to delete an inode if we happen to be the last holders of dentry reference which happens to be the last holder of inode reference. That in turn may violate lock ordering for some filesystems since notification_mutex is also acquired e. g. during write when generating fanotify event. Also this is the only thing that forces notification_mutex to be a sleeping lock. So drop notification_mutex before destroying a notification event. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jan Kara <[email protected]> Cc: Miklos Szeredi <[email protected]> Cc: Lino Sanfilippo <[email protected]> Cc: Eric Paris <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions