All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] epoll: clear the tfile_check_list on -ELOOP
@ 2012-04-17 14:34 Jason Baron
  2012-04-17 21:13 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Baron @ 2012-04-17 14:34 UTC (permalink / raw)
  To: akpm; +Cc: Yurij.Plotnikov, Alexandra.Kossovsky, davidel, nelhage,
	linux-kernel

An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent
circular epoll dependencies from being created. However, in that case
we do not properly clear the 'tfile_check_list'. Thus, add a call to
clear_tfile_check_list() for the -ELOOP case.

Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru>
Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 fs/eventpoll.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 739b098..c0b3c70 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1663,8 +1663,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
 	if (op == EPOLL_CTL_ADD) {
 		if (is_file_epoll(tfile)) {
 			error = -ELOOP;
-			if (ep_loop_check(ep, tfile) != 0)
+			if (ep_loop_check(ep, tfile) != 0) {
+				clear_tfile_check_list();
 				goto error_tgt_fput;
+			}
 		} else
 			list_add(&tfile->f_tfile_llink, &tfile_check_list);
 	}
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-19 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 14:34 [PATCH] epoll: clear the tfile_check_list on -ELOOP Jason Baron
2012-04-17 21:13 ` Andrew Morton
2012-04-18  4:56   ` Alexandra N. Kossovsky
2012-04-19 15:34     ` Jason Baron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.