From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/4] cifs: make cifs_lookup return a dentry
Date: Sat, 22 May 2010 15:46:15 +0100 [thread overview]
Message-ID: <20100522144615.GN31073@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100522100836.28b95cff@tlielax.poochiereds.net>
On Sat, May 22, 2010 at 10:08:36AM -0400, Jeff Layton wrote:
> On Sat, 22 May 2010 14:30:51 +0100
> Al Viro <viro@ZenIV.linux.org.uk> wrote:
>
> > On Fri, May 21, 2010 at 02:25:14PM -0400, Jeff Layton wrote:
> > > cifs_lookup doesn't actually return a dentry. It instantiates the one
> > > that's passed in, but callers don't have any way to know if the lookup
> > > succeeded.
> >
> > Huh? Of course they do - ->lookup() has every right to do just that;
> > d_add() and return NULL is perfectly legitimate.
>
> OK, bad description on my part... Is one way of doing this preferred
> over another?
Non-NULL, non ERR_PTR() strongly implies that you have found a different
dentry and tell the caller to use it instead; returning the argument (after
having cached it and bumped its refcount) will work, but it's pretty much
a deliberate obfuscation.
next prev parent reply other threads:[~2010-05-22 14:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-21 18:25 [PATCH 0/4] cifs: fix "Busy inodes after umount" issues (RFC) Jeff Layton
2010-05-21 18:25 ` [PATCH 1/4] cifs: make cifs_lookup return a dentry Jeff Layton
2010-05-21 18:45 ` Josef Bacik
2010-05-21 18:42 ` Jeff Layton
2010-05-22 13:30 ` Al Viro
2010-05-22 14:08 ` Jeff Layton
2010-05-22 14:46 ` Al Viro [this message]
2010-05-22 15:23 ` Jeff Layton
2010-05-21 18:25 ` [PATCH 2/4] cifs: don't leave open files dangling Jeff Layton
2010-05-24 6:50 ` [linux-cifs-client] " Suresh Jayaraman
2010-05-24 10:49 ` Jeff Layton
2010-05-21 18:25 ` [PATCH 3/4] cifs: move cifs_new_fileinfo call out of cifs_posix_open Jeff Layton
2010-05-24 6:50 ` [linux-cifs-client] " Suresh Jayaraman
2010-05-24 10:48 ` Jeff Layton
2010-05-21 18:25 ` [PATCH 4/4] cifs: pass instantiated filp back after open call Jeff Layton
2010-05-24 7:13 ` [PATCH 0/4] cifs: fix "Busy inodes after umount" issues (RFC) Suresh Jayaraman
2010-05-24 10:52 ` [linux-cifs-client] " Jeff Layton
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=20100522144615.GN31073@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@vger.kernel.org \
/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).