From: NeilBrown <neilb@suse.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/8] NFS: prepare for RCU-walk support but pushing tests later in code.
Date: Wed, 5 Mar 2014 16:59:33 +1100 [thread overview]
Message-ID: <20140305165933.09ca9d84@notabene.brown> (raw)
In-Reply-To: <20140305053441.GX18016@ZenIV.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
On Wed, 5 Mar 2014 05:34:41 +0000 Al Viro <viro@ZenIV.linux.org.uk> wrote:
> On Wed, Mar 05, 2014 at 02:00:28PM +1100, NeilBrown wrote:
> > - parent = dget_parent(dentry);
> > + parent = rcu_dereference(dentry->d_parent);
> > + else
> > + parent = dget_parent(dentry);
> > dir = parent->d_inode;
> > nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
>
Hi Al,
thanks for the review.
> ... and in RCU mode there's nothing to stop parent from
> a) not being dentry->d_parent anymore
Does that matter? Surely dentry->d_parent exists, is still a dentry, and was
recently the parent to dentry (i.e. since the last grace period). If it has
changed (which it must if it is no longer our parent), then the cache
validity checks are bound to fail and we will fall back to refcnt-walk as we
should.
> b) having already become negative.
I didn't think dentries ever became negative. When a file is deleted the old
positive dentry is unlinked and a new negative dentry is created in it's
place.
Or has that changed since last I looked?
If they can become negative, then I could
dir = ACCESS_ONCE(parent->d_inode);
if (!dir)
return -ECHILD;
Do you think that would be safe?
Thanks,
NeilBrown
>
> NAK.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2014-03-05 5:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 3:00 [PATCH/RFC 0/8] Extend RCU-walk support to NFS NeilBrown
2014-03-05 3:00 ` [PATCH 6/8] NFS: teach nfs_neg_need_reval to understand LOOKUP_RCU NeilBrown
2014-03-05 3:00 ` [PATCH 2/8] NFS: prepare for RCU-walk support but pushing tests later in code NeilBrown
2014-03-05 5:34 ` Al Viro
2014-03-05 5:59 ` NeilBrown [this message]
2014-03-05 6:49 ` Al Viro
2014-03-06 5:47 ` NeilBrown
2014-03-05 3:00 ` [PATCH 8/8] NFS: allow lockless access to access_cache NeilBrown
2014-03-05 15:11 ` Trond Myklebust
2014-03-06 6:03 ` NeilBrown
2014-03-05 3:00 ` [PATCH 5/8] NFS: teach nfs_do_access to understand MAY_NOT_BLOCK NeilBrown
2014-03-05 3:00 ` [PATCH 7/8] NFS: teach nfs_lookup_verify_inode to handle LOOKUP_RCU NeilBrown
2014-03-05 3:00 ` [PATCH 3/8] sunrpc/auth: allow lockless (rcu) lookup of credential cache NeilBrown
2014-03-05 3:00 ` [PATCH 4/8] sunrpc/auth: add 'rcu_walk' arg to rpc_lookup_cred NeilBrown
2014-03-05 14:43 ` Trond Myklebust
2014-03-06 5:50 ` NeilBrown
2014-03-05 3:00 ` [PATCH 1/8] NFS: nfs4_lookup_revalidate: only evaluate parent if it will be used NeilBrown
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=20140305165933.09ca9d84@notabene.brown \
--to=neilb@suse.de \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
--cc=viro@ZenIV.linux.org.uk \
/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).