Linux filesystem development
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Tyler Hicks <code@tyhicks.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Andreas Gruenbacher <agruenba@redhat.com>
Subject: Re: [PATCH 1/6] tracefs: use d_splice_alias() in ->lookup() instances
Date: Tue, 9 Jun 2026 18:26:55 -0400	[thread overview]
Message-ID: <20260609182655.3a907b49@fedora> (raw)
In-Reply-To: <20260606064956.2722874-2-viro@zeniv.linux.org.uk>

On Sat,  6 Jun 2026 07:49:51 +0100
Al Viro <viro@zeniv.linux.org.uk> wrote:

> d_add() is not wrong there (inodes are freshly allocated), but
> d_splice_alias() is more idiomatic.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

This looks fine to me, but I haven't tested it. But anyway:

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> ---
>  fs/tracefs/event_inode.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c
> index 26b6453de30e..39c7a34531e8 100644
> --- a/fs/tracefs/event_inode.c
> +++ b/fs/tracefs/event_inode.c
> @@ -389,8 +389,7 @@ static struct dentry *lookup_file(struct eventfs_inode *parent_ei,
>  	// Files have their parent's ei as their fsdata
>  	dentry->d_fsdata = get_ei(parent_ei);
>  
> -	d_add(dentry, inode);
> -	return NULL;
> +	return d_splice_alias(inode, dentry);
>  };
>  
>  /**
> @@ -420,8 +419,7 @@ static struct dentry *lookup_dir_entry(struct dentry *dentry,
>  
>  	dentry->d_fsdata = get_ei(ei);
>  
> -	d_add(dentry, inode);
> -	return NULL;
> +	return d_splice_alias(inode, dentry);
>  }
>  
>  static inline struct eventfs_inode *init_ei(struct eventfs_inode *ei, const char *name)


  reply	other threads:[~2026-06-09 22:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-06  6:49 [PATCH 0/6] d_add() misuses in ->lookup() Al Viro
2026-06-06  6:49 ` [PATCH 1/6] tracefs: use d_splice_alias() in ->lookup() instances Al Viro
2026-06-09 22:26   ` Steven Rostedt [this message]
2026-06-06  6:49 ` [PATCH 2/6] configfs_lookup(): switch to d_splice_alias() Al Viro
2026-06-06  6:49 ` [PATCH 3/6] ecryptfs: use d_splice_alias() for ->lookup() return value Al Viro
2026-06-06  6:49 ` [PATCH 4/6] simple_lookup(): " Al Viro
2026-06-06  6:49 ` [PATCH 5/6] ntfs: " Al Viro
2026-06-06 12:26   ` Namjae Jeon
2026-06-06  6:49 ` [PATCH 6/6] gfs2: " Al Viro
2026-06-06 12:48   ` Andreas Gruenbacher
2026-06-06 12:51 ` [PATCH 0/6] d_add() misuses in ->lookup() Andreas Gruenbacher
2026-06-14 22:32 ` [git pull] vfs: " Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260609182655.3a907b49@fedora \
    --to=rostedt@goodmis.org \
    --cc=a.hindborg@kernel.org \
    --cc=agruenba@redhat.com \
    --cc=brauner@kernel.org \
    --cc=code@tyhicks.com \
    --cc=jack@suse.cz \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox