From: Al Viro <viro@zeniv.linux.org.uk>
To: Luis Henriques <luis@igalia.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
mszeredi@suse.cz, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-dev@igalia.com
Subject: Re: [PATCH] fuse: add missing iput() in fuse_lookup() error path
Date: Fri, 19 Dec 2025 22:14:26 +0000 [thread overview]
Message-ID: <20251219221426.GA1712166@ZenIV> (raw)
In-Reply-To: <20251219221031.GZ1712166@ZenIV>
On Fri, Dec 19, 2025 at 10:10:31PM +0000, Al Viro wrote:
> On Fri, Dec 19, 2025 at 05:43:09PM +0000, Luis Henriques wrote:
> > The inode use count needs to be dropped in the fuse_lookup() error path,
> > when there's an error returned by d_splice_alias().
> >
> > (While there, remove extra white spaces before labels.)
> >
> > Fixes: 5835f3390e35 ("fuse: use d_materialise_unique()")
> > Signed-off-by: Luis Henriques <luis@igalia.com>
>
> Have you actually looked at d_splice_alias()?
>
> It does consume inode reference in all cases, success or error. On success
> it gets transferred to dentry; on failure it is dropped. That's quite
> deliberate, since it makes life much simplier for failure handling in the
> callers.
>
> If you can reproduce a leak there, I would like to see a reproducer.
> If not, I would say that your patch introduces a double-iput.
>
> NAK.
PS: out_iput in there is needed only on one failure exit - after we'd
found an inode and before we'd passed it to d_splice_alias().
FWIW, I would rather replace that with
if (inode && get_node_id(inode) == FUSE_ROOT_ID) {
iput(inode);
return ERR_PTR(-EIO);
}
and turned all goto out_err; into direct returns.
next prev parent reply other threads:[~2025-12-19 22:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 17:43 [PATCH] fuse: add missing iput() in fuse_lookup() error path Luis Henriques
2025-12-19 22:10 ` Al Viro
2025-12-19 22:14 ` Al Viro [this message]
2025-12-23 14:31 ` Luis Henriques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219221426.GA1712166@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=kernel-dev@igalia.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luis@igalia.com \
--cc=miklos@szeredi.hu \
--cc=mszeredi@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.