diff mbox series

[v3,6/8] ref_tracker: widen the ref_tracker_dir.name field

Message ID 20250417-reftrack-dbgfs-v3-6-c3159428c8fb@kernel.org (mailing list archive)
State Superseded
Headers show
Series ref_tracker: add ability to register a debugfs file for a ref_tracker_dir | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Jeff Layton April 17, 2025, 1:11 p.m. UTC
Currently it's 32 bytes, but with the need to move to unique names for
debugfs files, that won't be enough. Move to a 64 byte name field.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 include/linux/ref_tracker.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Andrew Lunn April 17, 2025, 7:29 p.m. UTC | #1
On Thu, Apr 17, 2025 at 09:11:09AM -0400, Jeff Layton wrote:
> Currently it's 32 bytes, but with the need to move to unique names for
> debugfs files, that won't be enough. Move to a 64 byte name field.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Jeff Layton April 17, 2025, 9:27 p.m. UTC | #2
On Thu, 2025-04-17 at 21:29 +0200, Andrew Lunn wrote:
> On Thu, Apr 17, 2025 at 09:11:09AM -0400, Jeff Layton wrote:
> > Currently it's 32 bytes, but with the need to move to unique names for
> > debugfs files, that won't be enough. Move to a 64 byte name field.
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 


Thanks for the review!

It occurs to me that we don't technically need this patch, since
ref_tracker_dir_debugfs() doesn't overwrite dir->name in this version.
Perhaps we should drop this patch, or I could define the
REF_TRACKER_NAMESZ constant and just leave it at 32?
Andrew Lunn April 17, 2025, 9:54 p.m. UTC | #3
On Thu, Apr 17, 2025 at 05:27:05PM -0400, Jeff Layton wrote:
> On Thu, 2025-04-17 at 21:29 +0200, Andrew Lunn wrote:
> > On Thu, Apr 17, 2025 at 09:11:09AM -0400, Jeff Layton wrote:
> > > Currently it's 32 bytes, but with the need to move to unique names for
> > > debugfs files, that won't be enough. Move to a 64 byte name field.
> > > 
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > 
> > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > 
> 
> 
> Thanks for the review!
> 
> It occurs to me that we don't technically need this patch, since
> ref_tracker_dir_debugfs() doesn't overwrite dir->name in this version.

I had not noticed that. I don't know if that is good or bad. Two
different names for the same thing. Nice thing is, this is debugfs, so
we are not setting an ABI. We can change this any time we want.

> Perhaps we should drop this patch, or I could define the
> REF_TRACKER_NAMESZ constant and just leave it at 32?

Having the constant might make future changes easier to make, avoid
having to find the hard coded 32.

	Andrew
diff mbox series

Patch

diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h
index 77a55a32c067216fa02ba349498f53bd289aee0c..e47e81fd048812251eca2820a8b1e89f5750de3a 100644
--- a/include/linux/ref_tracker.h
+++ b/include/linux/ref_tracker.h
@@ -7,6 +7,8 @@ 
 #include <linux/stackdepot.h>
 #include <linux/seq_file.h>
 
+#define REF_TRACKER_NAMESZ	64
+
 struct ref_tracker;
 
 struct ref_tracker_dir {
@@ -21,7 +23,7 @@  struct ref_tracker_dir {
 #ifdef CONFIG_DEBUG_FS
 	struct dentry		*dentry;
 #endif
-	char			name[32];
+	char			name[REF_TRACKER_NAMESZ];
 #endif
 };