From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jeff Layton <jlayton@kernel.org>,
Ilya Dryomov <idryomov@gmail.com>,
ceph-devel@vger.kernel.org,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7
Date: Fri, 26 Apr 2019 18:01:08 +0100 [thread overview]
Message-ID: <20190426170108.GZ2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAHk-=wiaZoELovfo4gkfxB0zi6k5pQJNkmSRsEoWYr_z-oupiQ@mail.gmail.com>
On Fri, Apr 26, 2019 at 09:36:00AM -0700, Linus Torvalds wrote:
> On Fri, Apr 26, 2019 at 9:25 AM Jeff Layton <jlayton@kernel.org> wrote:
> >
> > Is it really ok to union the count and rcu_head there?
>
> It should be fine, because the rcu_count should only ever be used once
> the count has gone to zero and the name cannot be found any more.
>
> And while RCU path walking may find and use the *name* after the
> dentry has been killed off (but not free'd yet), all the actual
> external_name() accesses should be serialized by the dentry lock, so
> there's no access to those fields once the dentry is dead.
It's not quite that; access to external_name contents is fine,
->d_lock or not. __d_lookup_rcu() does read it under rcu_read_lock
alone.
However:
* we never free it without an RCU delay after the final
drop of refcount. RCU delay might happen on dentry->d_rcu (if
it's dentry_free()) or on name->p.rcu (if it's release_dentry_name_snapshot()
or d_move() dropping the final reference).
* it's never observed in ->d_name after the refcount
reaches zero.
* no lockless access ever looks at the refcount. It
can look at ->name[], but that's it.
What I don't understand is why would anyone want to mess with
name snapshots for dentry_path() lookalikes...
next prev parent reply other threads:[~2019-04-26 17:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 17:47 [GIT PULL] Ceph fixes for 5.1-rc7 Ilya Dryomov
2019-04-25 18:02 ` Linus Torvalds
2019-04-25 18:21 ` Al Viro
2019-04-25 18:24 ` Linus Torvalds
2019-04-25 18:31 ` Al Viro
2019-04-25 18:36 ` Jeff Layton
2019-04-25 18:23 ` Jeff Layton
2019-04-25 20:09 ` Al Viro
2019-04-26 16:25 ` Jeff Layton
2019-04-26 16:36 ` Linus Torvalds
2019-04-26 16:43 ` Linus Torvalds
2019-04-26 17:01 ` Al Viro [this message]
2019-04-26 17:08 ` Linus Torvalds
2019-04-26 17:11 ` Al Viro
2019-04-26 20:49 ` Jeff Layton
2019-04-26 21:28 ` Al Viro
2019-04-26 16:50 ` Al Viro
2019-04-26 17:30 ` Jeff Layton
2019-04-28 4:38 ` Al Viro
2019-04-28 13:27 ` Jeff Layton
2019-04-28 14:48 ` Al Viro
2019-04-28 15:47 ` Jeff Layton
2019-04-28 15:52 ` Al Viro
2019-04-28 16:18 ` Jeff Layton
2019-04-28 16:40 ` Al Viro
2019-04-25 18:35 ` pr-tracker-bot
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=20190426170108.GZ2217@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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