From: Al Viro <viro@ZenIV.linux.org.uk>
To: Richard Weinberger <richard@nod.at>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: Detect API misuse of i_op->lookup
Date: Sun, 25 Jan 2015 22:16:43 +0000 [thread overview]
Message-ID: <20150125221643.GK29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1422223060-8561-1-git-send-email-richard@nod.at>
On Sun, Jan 25, 2015 at 10:57:40PM +0100, Richard Weinberger wrote:
> Hunting down a refcount issue in an out-of-tree filesystem uncovered
> that its lookup function directly returned the dentry which was passed to it.
> Add a BUG_ON() to detect such misuse in future.
In principle, it's not a bug. You *must* grab a reference to dentry before
returning it, but you can very well decide to return the one you've got -
any place where have ->lookup() return NULL has every right to become
return dget(dentry).
next prev parent reply other threads:[~2015-01-25 22:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-25 21:57 [PATCH] fs: Detect API misuse of i_op->lookup Richard Weinberger
2015-01-25 22:16 ` Al Viro [this message]
2015-01-25 22:20 ` Richard Weinberger
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=20150125221643.GK29656@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).