kernel-ark/fs/notify
Lino Sanfilippo 03a1cec1f1 fanotify: dont merge permission events
Boyd Yang reported a problem for the case that multiple threads of the same
thread group are waiting for a reponse for a permission event.
In this case it is possible that some of the threads are never woken up, even
if the response for the event has been received
(see http://marc.info/?l=linux-kernel&m=131822913806350&w=2).

The reason is that we are currently merging permission events if they belong to
the same thread group. But we are not prepared to wake up more than one waiter
for each event. We do

wait_event(group->fanotify_data.access_waitq, event->response ||
			atomic_read(&group->fanotify_data.bypass_perm));
and after that
  event->response = 0;

which is the reason that even if we woke up all waiters for the same event
some of them may see event->response being already set 0 again, then go back to
sleep and block forever.

With this patch we avoid that more than one thread is waiting for a response
by not merging permission events for the same thread group any more.

Reported-by: Boyd Yang <boyd.yang@gmail.com>
Signed-off-by: Lino Sanfilippo <LinoSanfilipp@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
2012-12-11 13:44:37 -05:00
..
dnotify fsnotify: pass group to fsnotify_destroy_mark() 2012-12-11 13:44:36 -05:00
fanotify fanotify: dont merge permission events 2012-12-11 13:44:37 -05:00
inotify fsnotify: make fasync generic for both inotify and fanotify 2012-12-11 13:44:36 -05:00
fsnotify.c vfs: switch i_dentry/d_alias to hlist 2012-07-14 16:32:55 +04:00
fsnotify.h fsnotify: remove global fsnotify groups lists 2010-07-28 10:18:54 -04:00
group.c fsnotify: make fasync generic for both inotify and fanotify 2012-12-11 13:44:36 -05:00
inode_mark.c fsnotify: pass group to fsnotify_destroy_mark() 2012-12-11 13:44:36 -05:00
Kconfig fanotify: allow fanotify to be built 2010-10-28 17:22:13 -04:00
Makefile fsnotify: vfsmount marks generic functions 2010-07-28 09:58:57 -04:00
mark.c fsnotify: change locking order 2012-12-11 13:44:36 -05:00
notification.c fsnotify: make fasync generic for both inotify and fanotify 2012-12-11 13:44:36 -05:00
vfsmount_mark.c fsnotify: pass group to fsnotify_destroy_mark() 2012-12-11 13:44:36 -05:00