aboutsummaryrefslogtreecommitdiff
path: root/fs/proc/fd.c
diff options
context:
space:
mode:
authorChristian Brauner <[email protected]>2024-10-10 12:00:03 +0200
committerChristian Brauner <[email protected]>2024-10-30 09:58:02 +0100
commit2ec67bb4f9c08000982d6aa0e72511bcc83caeb6 (patch)
treeb5c0b8fc842d830247b4e01cefdb37d94a2cb2ad /fs/proc/fd.c
parent62eec753cae265002043872ba419d0887fe33ec6 (diff)
parent6a8126f077f9d1f33613c9fa3dbd9a6774c6c4dd (diff)
Merge branch 'work.fdtable' into vfs.file
Bring in the fdtable changes for this cycle. Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/proc/fd.c')
-rw-r--r--fs/proc/fd.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 1f54a54bfb91..18d0dddc8e2f 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -116,9 +116,7 @@ static bool tid_fd_mode(struct task_struct *task, unsigned fd, fmode_t *mode)
{
struct file *file;
- rcu_read_lock();
- file = task_lookup_fdget_rcu(task, fd);
- rcu_read_unlock();
+ file = fget_task(task, fd);
if (file) {
*mode = file->f_mode;
fput(file);
@@ -258,19 +256,17 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
if (!dir_emit_dots(file, ctx))
goto out;
- rcu_read_lock();
for (fd = ctx->pos - 2;; fd++) {
struct file *f;
struct fd_data data;
char name[10 + 1];
unsigned int len;
- f = task_lookup_next_fdget_rcu(p, &fd);
+ f = fget_task_next(p, &fd);
ctx->pos = fd + 2LL;
if (!f)
break;
data.mode = f->f_mode;
- rcu_read_unlock();
fput(f);
data.fd = fd;
@@ -278,11 +274,9 @@ static int proc_readfd_common(struct file *file, struct dir_context *ctx,
if (!proc_fill_cache(file, ctx,
name, len, instantiate, p,
&data))
- goto out;
+ break;
cond_resched();
- rcu_read_lock();
}
- rcu_read_unlock();
out:
put_task_struct(p);
return 0;