Commit 0df2ac59 authored by Mathias Krause's avatar Mathias Krause Committed by Steven Rostedt (Google)

tracefs: Fix inode allocation

The leading comment above alloc_inode_sb() is pretty explicit about it:

  /*
   * This must be used for allocating filesystems specific inodes to set
   * up the inode reclaim context correctly.
   */

Switch tracefs over to alloc_inode_sb() to make sure inodes are properly
linked.

Cc: Ajay Kaher <ajay.kaher@broadcom.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20240807115143.45927-2-minipli@grsecurity.net
Fixes: ba37ff75 ("eventfs: Implement tracefs_inode_cache")
Signed-off-by: default avatarMathias Krause <minipli@grsecurity.net>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 6e2fdcef
...@@ -42,7 +42,7 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb) ...@@ -42,7 +42,7 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb)
struct tracefs_inode *ti; struct tracefs_inode *ti;
unsigned long flags; unsigned long flags;
ti = kmem_cache_alloc(tracefs_inode_cachep, GFP_KERNEL); ti = alloc_inode_sb(sb, tracefs_inode_cachep, GFP_KERNEL);
if (!ti) if (!ti)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment