Re: [RFC PATCH 0/6] debugfs: Replace dentry with an opaque handle in debugfs API

From: David Reaver
Date: Mon Feb 10 2025 - 12:59:38 EST


Steven Rostedt <rostedt@xxxxxxxxxxx> writes:

>
> No it will not be fine. You should not be using dentry at all. I thought
> this was going to convert debugfs over to kernfs. The debugfs_node should
> be using kernfs and completely eliminate the use of dentry.
>
> <snip>
>
> What caller should ever touch a dentry? What I got from my "conversation"
> with Linus, is that dentry is an internal caching descriptor of the VFS
> layer, and should only be used by the VFS layer. Nothing outside of VFS
> should ever need a dentry.
>
> -- Steve

I agree that just wrapping a dentry shouldn't be the final state for
debugfs_node, but this patch series is _only_ trying to introduce
debugfs_node as an opaque wrapper/handle.

It isn't clear to me that there is consensus on even using kernfs for
debugfs. Even if there was consensus, a full conversion to kernfs would
take 10x as much code and be extremely difficult to automate. For
example, using kernfs would require migrating all of the debugfs users'
file_operations to use the kernfs equivalent.

I figure any change away from persistent dentry handles for debugfs
requires introducing something akin to debugfs_node, so we could get
that out of the way first.

Thanks,
David Reaver