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>

Changed files
+2 -2
fs
tracefs
+2 -2
fs/tracefs/event_inode.c
··· 95 if (!(dentry->d_inode->i_mode & S_IFDIR)) { 96 if (!ei->entry_attrs) { 97 ei->entry_attrs = kzalloc(sizeof(*ei->entry_attrs) * ei->nr_entries, 98 - GFP_KERNEL); 99 if (!ei->entry_attrs) { 100 ret = -ENOMEM; 101 goto out; ··· 627 { 628 struct dentry **tmp; 629 630 - tmp = krealloc(*dentries, sizeof(d) * (cnt + 2), GFP_KERNEL); 631 if (!tmp) 632 return -1; 633 tmp[cnt] = d;
··· 95 if (!(dentry->d_inode->i_mode & S_IFDIR)) { 96 if (!ei->entry_attrs) { 97 ei->entry_attrs = kzalloc(sizeof(*ei->entry_attrs) * ei->nr_entries, 98 + GFP_NOFS); 99 if (!ei->entry_attrs) { 100 ret = -ENOMEM; 101 goto out; ··· 627 { 628 struct dentry **tmp; 629 630 + tmp = krealloc(*dentries, sizeof(d) * (cnt + 2), GFP_NOFS); 631 if (!tmp) 632 return -1; 633 tmp[cnt] = d;