linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blktrace: remove debugfs file dentries from struct blk_trace
@ 2021-02-16 15:52 Greg Kroah-Hartman
  2021-02-22 23:02 ` Steven Rostedt
  2021-02-23 16:54 ` Jens Axboe
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-16 15:52 UTC (permalink / raw)
  To: axboe, rostedt, mingo; +Cc: Greg Kroah-Hartman, linux-block, linux-kernel

These debugfs dentries do not need to be saved for anything as the whole
directory and everything in it is properly cleaned up when the parent
directory is removed.  So remove them from struct blk_trace and don't
save them when created as it's not necessary.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/blktrace_api.h | 2 --
 kernel/trace/blktrace.c      | 8 ++------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 05556573b896..79979d33c140 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -23,8 +23,6 @@ struct blk_trace {
 	u32 pid;
 	u32 dev;
 	struct dentry *dir;
-	struct dentry *dropped_file;
-	struct dentry *msg_file;
 	struct list_head running_list;
 	atomic_t dropped;
 };
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index fb0fe4c66b84..67c730f0b6ef 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -311,8 +311,6 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
 
 static void blk_trace_free(struct blk_trace *bt)
 {
-	debugfs_remove(bt->msg_file);
-	debugfs_remove(bt->dropped_file);
 	relay_close(bt->rchan);
 	debugfs_remove(bt->dir);
 	free_percpu(bt->sequence);
@@ -544,10 +542,8 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	INIT_LIST_HEAD(&bt->running_list);
 
 	ret = -EIO;
-	bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
-					       &blk_dropped_fops);
-
-	bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
+	debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
+	debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
 
 	bt->rchan = relay_open("trace", dir, buts->buf_size,
 				buts->buf_nr, &blk_relay_callbacks, bt);
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] blktrace: remove debugfs file dentries from struct blk_trace
  2021-02-16 15:52 [PATCH] blktrace: remove debugfs file dentries from struct blk_trace Greg Kroah-Hartman
@ 2021-02-22 23:02 ` Steven Rostedt
  2021-02-23 16:54   ` Jens Axboe
  2021-02-23 16:54 ` Jens Axboe
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2021-02-22 23:02 UTC (permalink / raw)
  To: axboe; +Cc: Greg Kroah-Hartman, mingo, linux-block, linux-kernel


Jens,

I guess this goes through your tree.

I'm pinging you in case you did what I did, and confused this patch as one
of Greg's stable patches (which I almost archived as such)!

No, this is an actual update from Greg, not a patch that was backported.

-- Steve

On Tue, 16 Feb 2021 16:52:47 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> These debugfs dentries do not need to be saved for anything as the whole
> directory and everything in it is properly cleaned up when the parent
> directory is removed.  So remove them from struct blk_trace and don't
> save them when created as it's not necessary.
> 
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: linux-block@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  include/linux/blktrace_api.h | 2 --
>  kernel/trace/blktrace.c      | 8 ++------
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
> index 05556573b896..79979d33c140 100644
> --- a/include/linux/blktrace_api.h
> +++ b/include/linux/blktrace_api.h
> @@ -23,8 +23,6 @@ struct blk_trace {
>  	u32 pid;
>  	u32 dev;
>  	struct dentry *dir;
> -	struct dentry *dropped_file;
> -	struct dentry *msg_file;
>  	struct list_head running_list;
>  	atomic_t dropped;
>  };
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index fb0fe4c66b84..67c730f0b6ef 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -311,8 +311,6 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
>  
>  static void blk_trace_free(struct blk_trace *bt)
>  {
> -	debugfs_remove(bt->msg_file);
> -	debugfs_remove(bt->dropped_file);
>  	relay_close(bt->rchan);
>  	debugfs_remove(bt->dir);
>  	free_percpu(bt->sequence);
> @@ -544,10 +542,8 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
>  	INIT_LIST_HEAD(&bt->running_list);
>  
>  	ret = -EIO;
> -	bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
> -					       &blk_dropped_fops);
> -
> -	bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
> +	debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
> +	debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
>  
>  	bt->rchan = relay_open("trace", dir, buts->buf_size,
>  				buts->buf_nr, &blk_relay_callbacks, bt);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blktrace: remove debugfs file dentries from struct blk_trace
  2021-02-22 23:02 ` Steven Rostedt
@ 2021-02-23 16:54   ` Jens Axboe
  2021-02-23 17:00     ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2021-02-23 16:54 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Greg Kroah-Hartman, mingo, linux-block, linux-kernel

On 2/22/21 4:02 PM, Steven Rostedt wrote:
> 
> Jens,
> 
> I guess this goes through your tree.
> 
> I'm pinging you in case you did what I did, and confused this patch as one
> of Greg's stable patches (which I almost archived as such)!
> 
> No, this is an actual update from Greg, not a patch that was backported.

I did! Greg really needs an alter-ego for these kinds of patches.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blktrace: remove debugfs file dentries from struct blk_trace
  2021-02-16 15:52 [PATCH] blktrace: remove debugfs file dentries from struct blk_trace Greg Kroah-Hartman
  2021-02-22 23:02 ` Steven Rostedt
@ 2021-02-23 16:54 ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2021-02-23 16:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, rostedt, mingo; +Cc: linux-block, linux-kernel

On 2/16/21 8:52 AM, Greg Kroah-Hartman wrote:
> These debugfs dentries do not need to be saved for anything as the whole
> directory and everything in it is properly cleaned up when the parent
> directory is removed.  So remove them from struct blk_trace and don't
> save them when created as it's not necessary.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blktrace: remove debugfs file dentries from struct blk_trace
  2021-02-23 16:54   ` Jens Axboe
@ 2021-02-23 17:00     ` Steven Rostedt
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2021-02-23 17:00 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Greg Kroah-Hartman, mingo, linux-block, linux-kernel

On Tue, 23 Feb 2021 09:54:22 -0700
Jens Axboe <axboe@kernel.dk> wrote:

> On 2/22/21 4:02 PM, Steven Rostedt wrote:
> > 
> > Jens,
> > 
> > I guess this goes through your tree.
> > 
> > I'm pinging you in case you did what I did, and confused this patch as one
> > of Greg's stable patches (which I almost archived as such)!
> > 
> > No, this is an actual update from Greg, not a patch that was backported.  
> 
> I did! Greg really needs an alter-ego for these kinds of patches.
> 

Or perhaps Greg needs to use "[UPSTREAM PATCH]" in his subjects for patches
he writes for upstream, to differentiate them from stable patches.

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-23 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 15:52 [PATCH] blktrace: remove debugfs file dentries from struct blk_trace Greg Kroah-Hartman
2021-02-22 23:02 ` Steven Rostedt
2021-02-23 16:54   ` Jens Axboe
2021-02-23 17:00     ` Steven Rostedt
2021-02-23 16:54 ` Jens Axboe

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).