From: Al Viro Date: Sun, 14 Aug 2022 19:16:18 +0000 (-0400) Subject: take care to handle NULL ->proc_lseek() X-Git-Tag: baikal/mips/sdk6.1~5016^2 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=445ba17cb8e2be93e7aac4703784170da7029c6e;p=kernel.git 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: b7e0530b858d "fs: remove no_llseek" Signed-off-by: Al Viro --- diff --git a/fs/proc/inode.c b/fs/proc/inode.c index f130499ad8432..f495fdb391517 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -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)