Re: [PATCH 4/6] fuse: return correct dentry for ->mkdir
From: Miklos Szeredi
Date: Mon Mar 03 2025 - 09:46:35 EST
On Thu, 27 Feb 2025 at 02:40, NeilBrown <neilb@xxxxxxx> wrote:
>
> fuse already uses d_splice_alias() to ensure an appropriate dentry is
> found for a newly created dentry. Now that ->mkdir can return that
> dentry we do so.
>
> This requires changing create_new_entry() to return a dentry and
> handling that change in all callers.
>
> Note that when create_new_entry() is asked to create anything other than
> a directory we can be sure it will NOT return an alternate dentry as
> d_splice_alias() only returns an alternate dentry for directories.
> So we don't need to check for that case when passing one the result.
Still, I'd create a wrapper for non-dir callers with the above comment.
As is, it's pretty confusing to deal with a "dentry", which is
apparently "leaked" (no dput) but in reality it's just err or NULL.
Thanks,
Miklos