]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 6 Feb 2024 12:09:31 +0000 (07:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:21 +0000 (09:25 +0100)
commit6586a12d3f029d3642a8a9f608fe5ed92ea6b7aa
tree772189a1530298a2adbaa450916620b3b854a12d
parent7b4cb5d59f3e8d31315d82f76c7313deea5ac8a2
eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held

commit 4763d635c907baed212664dc579dde1663bb2676 upstream.

If memory reclaim happens, it can reclaim file system pages. The file
system pages from eventfs may take the eventfs_mutex on reclaim. This
means that allocation while holding the eventfs_mutex must not call into
filesystem reclaim. A lockdep splat uncovered this.

Link: https://lkml.kernel.org/r/20231121231112.373501894@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: 28e12c09f5aa0 ("eventfs: Save ownership and mode")
Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/tracefs/event_inode.c