fanotify: move unrelated handling from copy_event_to_user()
authorJan Kara <jack@suse.cz>
Thu, 3 Apr 2014 21:46:36 +0000 (14:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:20:51 +0000 (16:20 -0700)
commitd507816b58bebc8f9c1bed6a28affaf0729306e2
treef82f5977b3a5e3b4e0c1b1f9bbf16b25e5a4c860
parentd8aaab4f619acfbfafc91d94b15c2932457c65fa
fanotify: move unrelated handling from copy_event_to_user()

Move code moving event structure to access_list from copy_event_to_user()
to fanotify_read() where it is more logical (so that we can immediately
see in the main loop that we either move the event to a different list
or free it).  Also move special error handling for permission events
from copy_event_to_user() to the main loop to have it in one place with
error handling for normal events.  This makes copy_event_to_user()
really only copy the event to user without any side effects.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/notify/fanotify/fanotify_user.c