eventfs: Remove fsnotify*() functions from lookup()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 1 Feb 2024 15:34:49 +0000 (10:34 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 1 Feb 2024 16:53:53 +0000 (11:53 -0500)
The dentries and inodes are created when referenced in the lookup code.
There's no reason to call fsnotify_*() functions when they are created by
a reference. It doesn't make any sense.

Link: https://lore.kernel.org/linux-trace-kernel/20240201002719.GS2087318@ZenIV/
Link: https://lore.kernel.org/linux-trace-kernel/20240201161617.166973329@goodmis.org
Cc: stable@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Ajay Kaher <ajay.kaher@broadcom.com>
Fixes: a376007917776 ("eventfs: Implement functions to create files and dirs when accessed");
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/event_inode.c

index ca7daee7c8115e342e7f652b144dd6bfa2600d19..9e031e5a2713b6b90418bfa96325e9d83fd9f161 100644 (file)
@@ -366,7 +366,6 @@ static struct dentry *lookup_file(struct eventfs_inode *parent_ei,
        dentry->d_fsdata = get_ei(parent_ei);
 
        d_add(dentry, inode);
-       fsnotify_create(dentry->d_parent->d_inode, dentry);
        return NULL;
 };
 
@@ -408,7 +407,6 @@ static struct dentry *lookup_dir_entry(struct dentry *dentry,
        inc_nlink(inode);
        d_add(dentry, inode);
        inc_nlink(dentry->d_parent->d_inode);
-       fsnotify_mkdir(dentry->d_parent->d_inode, dentry);
        return NULL;
 }