eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 21 Nov 2023 23:10:04 +0000 (18:10 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 22 Nov 2023 23:36:35 +0000 (18:36 -0500)
commit4763d635c907baed212664dc579dde1663bb2676
treeb11f6acbae95f733797de2c4d83d7eed9760a738
parent71cade82f2b553a74d046c015c986f2df165696f
eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held

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>
fs/tracefs/event_inode.c