summaryrefslogtreecommitdiffstats
path: root/fs/kernfs/file.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2024-04-09 09:48:09 +0200
committerIngo Molnar <mingo@kernel.org>2024-04-09 09:48:09 +0200
commitd1eec383a8abe348b5ce72df9e96bff3d9039134 (patch)
tree6ea912eb2d4f2bee8301a04ebf82283805218ebf /fs/kernfs/file.c
parentx86/tsc: Make __use_tsc __ro_after_init (diff)
parentLinux 6.9-rc3 (diff)
downloadlinux-d1eec383a8abe348b5ce72df9e96bff3d9039134.tar.xz
linux-d1eec383a8abe348b5ce72df9e96bff3d9039134.zip
Merge tag 'v6.9-rc3' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/kernfs/file.c')
-rw-r--r--fs/kernfs/file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index ffa4565c275a..e9df2f87072c 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -483,9 +483,11 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
goto out_put;
rc = 0;
- of->mmapped = true;
- of_on(of)->nr_mmapped++;
- of->vm_ops = vma->vm_ops;
+ if (!of->mmapped) {
+ of->mmapped = true;
+ of_on(of)->nr_mmapped++;
+ of->vm_ops = vma->vm_ops;
+ }
vma->vm_ops = &kernfs_vm_ops;
out_put:
kernfs_put_active(of->kn);