[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201204171434.q3HEYqrq007242@int-mx09.intmail.prod.int.phx2.redhat.com>
Date: Tue, 17 Apr 2012 10:34:52 -0400
From: Jason Baron <jbaron@...hat.com>
To: akpm@...ux-foundation.org
Cc: Yurij.Plotnikov@...etlabs.ru, Alexandra.Kossovsky@...etlabs.ru,
davidel@...ilserver.org, nelhage@...hage.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] epoll: clear the tfile_check_list on -ELOOP
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@...etlabs.ru>
Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@...etlabs.ru>
Signed-off-by: Jason Baron <jbaron@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists