Skip to content

Commit

Permalink
take care to handle NULL ->proc_lseek()
Browse files Browse the repository at this point in the history
Easily done now, just by clearing FMODE_LSEEK in ->f_mode
during proc_reg_open() for such entries.

Fixes: 868941b "fs: remove no_llseek"
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 14, 2022
1 parent 5d6a0f4 commit 3f61631
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/proc/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ static int proc_reg_open(struct inode *inode, struct file *file)
typeof_member(struct proc_ops, proc_release) release;
struct pde_opener *pdeo;

if (!pde->proc_ops->proc_lseek)
file->f_mode &= ~FMODE_LSEEK;

if (pde_is_permanent(pde)) {
open = pde->proc_ops->proc_open;
if (open)
Expand Down

0 comments on commit 3f61631

Please sign in to comment.