/proc/profile is created when profiling is turned on and never removed.
Say so with PROC_ENTRY_PERMANENT, procfs then calls into it without
pinning it. It keeps reading straight into userspace through
->proc_read() since readprofile reads the whole file in one go and a
copy of all of it through a procfs buffer doesn't buy anything for an
entry that can't go away.

Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 kernel/profile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/profile.c b/kernel/profile.c
index 6e4b34f35e3b..6f2441dd4a00 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -206,6 +206,7 @@ static ssize_t write_profile(struct file *file, char *buf, 
size_t count,
 }
 
 static const struct proc_ops profile_proc_ops = {
+       .proc_flags     = PROC_ENTRY_PERMANENT,
        .proc_read      = read_profile,
        .proc_write_buf = write_profile,
        .proc_lseek     = default_llseek,

-- 
2.53.0


Reply via email to