The fdinfo files and the ONE() files stash their inode in the seq_file's ->private. The seq_file points to the file anyway so get the inode from there and free up ->private. The following patches need it. No functional changes. Signed-off-by: Christian Brauner (Amutable) --- fs/proc/base.c | 4 ++-- fs/proc/fd.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index c9aebee0a338..2a9ad9e01047 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -781,7 +781,7 @@ static const struct inode_operations proc_def_inode_operations = { static int proc_single_show(struct seq_file *m, void *v) { - struct inode *inode = m->private; + struct inode *inode = file_inode(m->file); struct pid_namespace *ns = proc_pid_ns(inode->i_sb); struct pid *pid = proc_pid(inode); struct task_struct *task; @@ -799,7 +799,7 @@ static int proc_single_show(struct seq_file *m, void *v) static int proc_single_open(struct inode *inode, struct file *filp) { - return single_open(filp, proc_single_show, inode); + return single_open(filp, proc_single_show, NULL); } static const struct file_operations proc_single_file_operations = { diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 7214a7495380..839c984e1699 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -22,19 +22,20 @@ static int seq_show(struct seq_file *m, void *v) { + struct inode *inode = file_inode(m->file); struct files_struct *files = NULL; int f_flags = 0, ret = -ENOENT; struct file *file = NULL; struct task_struct *task; - task = get_proc_task(m->private); + task = get_proc_task(inode); if (!task) return -ENOENT; task_lock(task); files = task->files; if (files) { - unsigned int fd = proc_fd(m->private); + unsigned int fd = proc_fd(inode); spin_lock(&files->file_lock); file = files_lookup_fd_locked(files, fd); @@ -74,7 +75,7 @@ static int seq_show(struct seq_file *m, void *v) static int seq_fdinfo_open(struct inode *inode, struct file *file) { - return single_open(file, seq_show, inode); + return single_open(file, seq_show, NULL); } /* -- 2.53.0