summaryrefslogtreecommitdiffstats
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-10-01 20:11:00 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2020-10-26 01:02:07 +0100
commitb62d2706a754887800a7cec4eb0592a9263a38fc (patch)
tree7d9dea46a1883281abb51c5ef7ff4c76461a6a84 /fs/eventpoll.c
parentconvert ->f_ep_links/->fllink to hlist (diff)
downloadlinux-b62d2706a754887800a7cec4eb0592a9263a38fc.tar.xz
linux-b62d2706a754887800a7cec4eb0592a9263a38fc.zip
lift rcu_read_lock() into reverse_path_check()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r--fs/eventpoll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index c40576e62728..06674515132c 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1257,7 +1257,6 @@ static int reverse_path_check_proc(struct file *file, int depth)
return -1;
/* CTL_DEL can remove links here, but that can't increase our count */
- rcu_read_lock();
hlist_for_each_entry_rcu(epi, &file->f_ep_links, fllink) {
struct file *recepient = epi->ep->file;
if (WARN_ON(!is_file_epoll(recepient)))
@@ -1269,7 +1268,6 @@ static int reverse_path_check_proc(struct file *file, int depth)
if (error != 0)
break;
}
- rcu_read_unlock();
return error;
}
@@ -1291,7 +1289,9 @@ static int reverse_path_check(void)
/* let's call this for all tfiles */
list_for_each_entry(current_file, &tfile_check_list, f_tfile_llink) {
path_count_init();
+ rcu_read_lock();
error = reverse_path_check_proc(current_file, 0);
+ rcu_read_unlock();
if (error)
break;
}