blktrace: remove debugfs file dentries from struct blk_trace
Subsystems (2)
PATCH 1/1 blktrace: remove debugfs file dentries from struct blk_trace
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.
--- include/linux/blktrace_api.h | 2 -- kernel/trace/blktrace.c | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-)
include/linux/blktrace_api.h +0 -2
@@ -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; };
kernel/trace/blktrace.c +2 -6
@@ -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);
Signature · 1 line
2.30.1
Steven Rostedt
maintainerJens,
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
Quoted 55 lines · On Tue, 16 Feb 2021 16:52:47 +0100 Greg Kroah-Hartman…
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_traceand don't save them when created as it's not necessary.Cc Jens Axboe <[email protected]>Cc Steven Rostedt <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- include/linux/blktrace_api.h | 2 -- kernel/trace/blktrace.c | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-)include/linux/blktrace_api.h +0
-2@@ -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; };kernel/trace/blktrace.c +2
-6@@ -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);
Jens Axboe
maintainerQuoted 9 lines · Steven Rostedt
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.
Signature · 1 line
Jens Axboe
Steven Rostedt
maintainerQuoted 4 lines · On Tue, 23 Feb 2021 09:54:22 -0700 Jens Axboe <[email protected]> wrote:
Quoted 3 lines · Steven Rostedt
Jens,
Quoted 9 lines
Quoted 6 lines
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
Quoted 4 lines · Greg Kroah-Hartman
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_traceand don't save them when created as it's not necessary.
Applied, thanks.
Signature · 1 line
Jens Axboe