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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Feb 2025 08:08:25 -0800
David Reaver <me@xxxxxxxxxxxxxxx> wrote:

> Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> writes:
> 
> >
> > First off, many thanks for attempting this, I didn't think it was ready
> > to even be attempted, so it's very nice to see this.
> >  
> 
> No problem, and thank you for taking a look!
> 
> > That being said, I agree with Al, we can't embed a dentry in a structure
> > like that as the lifecycles are going to get messy fast.
> >  
> 
> Ack, I'll do something different in v2.
> 
> For my own education: what goes wrong with lifecycles with this embed?
> Feel free to point me at a doc or something.
> 
> Also, Al and Greg, would wrapping a pointer be fine?
> 
> 	struct debugfs_node {
> 		struct dentry *dentry;
> 	};

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.


> 
> I was trying to do the simplest thing possible so the bulk of the change
> was mechanical. Wrapping a pointer is slightly more complicated because
> we have to deal with memory allocation, but it is still totally doable.
> 
> > Also, your replacement of many of the dentry functions with wrappers
> > seems at bit odd, ideally you would just return a dentry from a call
> > like "debugfs_node_to_dentry()" and then let the caller do with it what
> > it wants to, that way you don't need to wrap everything.

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux