summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-09-02 11:29:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-09-02 11:29:34 -0700
commit54e54d58184e34887cc40d0bc83720dbaf57db1a (patch)
tree63339d4d456b89c11b01da35b3b84542eca492cb /fs
parent9c7d619be5a002ea29c172df5e3c1227c22cbb41 (diff)
parent77f4689de17c0887775bb77896f4cc11a39bf848 (diff)
Merge branch 'work.epoll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull epoll fixup from Al Viro: "Fixup for epoll regression; there's a better solution longer term, but this is the least intrusive fix" * 'work.epoll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix regression in "epoll: Keep a reference on files added to the check list"
Diffstat (limited to 'fs')
-rw-r--r--fs/eventpoll.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index e0decff22ae2..8107e06d7f6f 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1995,9 +1995,9 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
* during ep_insert().
*/
if (list_empty(&epi->ffd.file->f_tfile_llink)) {
- get_file(epi->ffd.file);
- list_add(&epi->ffd.file->f_tfile_llink,
- &tfile_check_list);
+ if (get_file_rcu(epi->ffd.file))
+ list_add(&epi->ffd.file->f_tfile_llink,
+ &tfile_check_list);
}
}
}