linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ajay Kaher <akaher@vmware.com>
Subject: Re: [PATCH v6 7/8] eventfs: Remove special processing of dput() of events directory
Date: Thu, 2 Nov 2023 11:14:26 +0900	[thread overview]
Message-ID: <20231102111426.5ca004d4f8fce591b536708c@kernel.org> (raw)
In-Reply-To: <20231101172650.340876747@goodmis.org>

On Wed, 01 Nov 2023 13:25:48 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> The top level events directory is no longer special with regards to how it
> should be delete. Remove the extra processing for it in
> eventfs_set_ei_status_free().
> 
Looks good to me.

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

> Cc: Ajay Kaher <akaher@vmware.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> Changes since v5: https://lkml.kernel.org/r/20231031223421.185413077@goodmis.org
> 
> - Resynced to this patch series
> 
>  fs/tracefs/event_inode.c | 19 ++-----------------
>  1 file changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c
> index 0a04ae0ca8c8..0087a3f455f1 100644
> --- a/fs/tracefs/event_inode.c
> +++ b/fs/tracefs/event_inode.c
> @@ -274,28 +274,11 @@ static void free_ei(struct eventfs_inode *ei)
>   */
>  void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry)
>  {
> -	struct tracefs_inode *ti_parent;
>  	struct eventfs_inode *ei;
>  	int i;
>  
> -	/* The top level events directory may be freed by this */
> -	if (unlikely(ti->flags & TRACEFS_EVENT_TOP_INODE)) {
> -		mutex_lock(&eventfs_mutex);
> -		ei = ti->private;
> -		/* Nothing should access this, but just in case! */
> -		ti->private = NULL;
> -		mutex_unlock(&eventfs_mutex);
> -
> -		free_ei(ei);
> -		return;
> -	}
> -
>  	mutex_lock(&eventfs_mutex);
>  
> -	ti_parent = get_tracefs(dentry->d_parent->d_inode);
> -	if (!ti_parent || !(ti_parent->flags & TRACEFS_EVENT_INODE))
> -		goto out;
> -
>  	ei = dentry->d_fsdata;
>  	if (!ei)
>  		goto out;
> @@ -920,6 +903,8 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
>  	inode->i_op = &eventfs_root_dir_inode_operations;
>  	inode->i_fop = &eventfs_file_operations;
>  
> +	dentry->d_fsdata = ei;
> +
>  	/* directory inodes start off with i_nlink == 2 (for "." entry) */
>  	inc_nlink(inode);
>  	d_instantiate(dentry, inode);
> -- 
> 2.42.0


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2023-11-02  2:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 17:25 [PATCH v6 0/8] eventfs: Fixing dynamic creation Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 1/8] eventfs: Remove "is_freed" union with rcu head Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 2/8] eventfs: Have a free_ei() that just frees the eventfs_inode Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 3/8] eventfs: Test for ei->is_freed when accessing ei->dentry Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 4/8] eventfs: Save ownership and mode Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 5/8] eventfs: Hold eventfs_mutex when calling callback functions Steven Rostedt
2023-11-01 23:48   ` Masami Hiramatsu
2023-11-01 17:25 ` [PATCH v6 6/8] eventfs: Delete eventfs_inode when the last dentry is freed Steven Rostedt
2023-11-01 17:25 ` [PATCH v6 7/8] eventfs: Remove special processing of dput() of events directory Steven Rostedt
2023-11-02  2:14   ` Masami Hiramatsu [this message]
2023-11-01 17:25 ` [PATCH v6 8/8] eventfs: Use simple_recursive_removal() to clean up dentries Steven Rostedt
2023-11-02  6:57   ` Masami Hiramatsu

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=20231102111426.5ca004d4f8fce591b536708c@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akaher@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).