Skip to content

Commit 77f4689

Browse files
author
Al Viro
committed
fix regression in "epoll: Keep a reference on files added to the check list"
epoll_loop_check_proc() can run into a file already committed to destruction; we can't grab a reference on those and don't need to add them to the set for reverse path check anyway. Tested-by: Marc Zyngier <[email protected]> Fixes: a9ed4a6 ("epoll: Keep a reference on files added to the check list") Signed-off-by: Al Viro <[email protected]>
1 parent 52c4796 commit 77f4689

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/eventpoll.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,9 +1995,9 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
19951995
* during ep_insert().
19961996
*/
19971997
if (list_empty(&epi->ffd.file->f_tfile_llink)) {
1998-
get_file(epi->ffd.file);
1999-
list_add(&epi->ffd.file->f_tfile_llink,
2000-
&tfile_check_list);
1998+
if (get_file_rcu(epi->ffd.file))
1999+
list_add(&epi->ffd.file->f_tfile_llink,
2000+
&tfile_check_list);
20012001
}
20022002
}
20032003
}

0 commit comments

Comments
 (0)