BACKPORT: take care to handle NULL ->proc_lseek()

Easily done now, just by clearing FMODE_LSEEK in ->f_mode
during proc_reg_open() for such entries.

Fixes: 868941b144 "fs: remove no_llseek"
Change-Id: Iac64d5d73ce9647a516eec870867369efe23cf33
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(cherry picked from commit 3f61631d47)
Signed-off-by: David Anderson <dvander@google.com>
This commit is contained in:
Al Viro
2022-08-14 15:16:18 -04:00
committed by David Anderson
parent 01bff4820f
commit 17cbc8f6c2

View File

@@ -489,6 +489,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)