Re: [PATCH 4/7] configfs: remove d_add() calls before configfs_attach_group()
From: NeilBrown
Date: Wed Sep 30 2026 - 21:33:03 EST
On Tue, 29 Sep 2026, Al Viro wrote:
> On Tue, Sep 29, 2026 at 01:36:04PM +1000, NeilBrown wrote:
> > From: NeilBrown <neil@xxxxxxxxxx>
> >
> > These d_add() calls cannot be necessary. The inode given is NULL so all
> > they do is attach the dentry to the hash table.
> >
> > If configfs_attach_group() fails, then d_drop() is called so the dentry
> > will be detached.
> > If configfs_attach_group() succeeds, then
> > configfs_attach_group -> configfs_attach_item ->configfs_create_dir
> > must have succeeded, so d_instantiate() will have been called and the
> > dentry hashed there.
>
> Neither in mainline, nor in -next...
I guess you are refering to d_instantiate() not being called here in
mainline or -next, because it has been replaced with
d_make_persistent()?? Sorry - old commit message.
>
> d_add() _is_ wrong there, but this is not the right solution. What
> we really ought to do is build the subtree first, then either dissolve
> it (without any pathname resolution having ever seen it) or move it
> in place once we are sure that everything worked.
>
I'll just drop this patch for now. I only want it as part of
deprecating d_add(), and that can wait.
Thanks,
NeilBrown