From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Boyer <jwboyer@gmail.com>, Waiman Long <Waiman.Long@hp.com>,
"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
moneta.mace@gmail.com
Subject: Re: kernel BUG at fs/dcache.c:648! with v3.11-7890-ge5c832d
Date: Tue, 10 Sep 2013 19:43:24 +0100 [thread overview]
Message-ID: <20130910184324.GY13318@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFygRtwwknO4Jb+nna046VhdNCXh2S0ybRBPf=b1GH9FPg@mail.gmail.com>
On Tue, Sep 10, 2013 at 11:25:44AM -0700, Linus Torvalds wrote:
> nd->flags &= ~LOOKUP_RCU;
> if (!(nd->flags & LOOKUP_ROOT))
> nd->root.mnt = NULL;
> unlock_rcu_walk();
>
> and my unlazy_walk() essentially terminated the walk _without_
> clearing that nd->root.mnt thing (it did clear the LOOKUP_RCU bit and
> unlock_rcy_walk(). So then later, we'd end up doing an extra
> path_put(). Explaining a zero d_lockref.count.
>
> The whole damn root.mnt behavior with !LOOKUP_ROOT is a mystery and
> needs more comments. But the attached trivial patch should do the
> missing portion of terminate_walk().
>
> Al, can you walk us through the rules for what "root.mnt == NULL"
> really means? It's basically used as a flag for whether we've gotten
> the root pointer or not. But it's pretty damn esoteric.
LOOKUP_ROOT: the caller has set nd->root and we shouldn't touch that
at all.
!LOOKUP_ROOT: we set nd->root the first time we need / (in the very
beginning if it's an absolute pathname, on the first absolute symlink
otherwise). In non-RCU mode we hold a reference to it; in RCU mode
we do not. As the result, leaving RCU mode should either grab
a reference to the damn thing (if we intend to go on) or zero it out.
next prev parent reply other threads:[~2013-09-10 18:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 17:14 kernel BUG at fs/dcache.c:648! with v3.11-7890-ge5c832d Josh Boyer
2013-09-10 17:33 ` Linus Torvalds
2013-09-10 17:39 ` Josh Boyer
2013-09-10 17:47 ` Linus Torvalds
2013-09-10 18:25 ` Linus Torvalds
[not found] ` <CAMfhy93EoDohCrV+ykj6b+R9QSCTdiPtvSpJpe3SH=ot_1LWMg@mail.gmail.com>
2013-09-10 18:32 ` Linus Torvalds
[not found] ` <CAMfhy92u1GFvTrO+8SNp8hoEBEHcd7Z-3mw+79rv8+2yYqa+ow@mail.gmail.com>
[not found] ` <CAMfhy90vEu2_hfoOnzB+ZOit4HNmKex2WObmztcY7R4+PBwd7w@mail.gmail.com>
2013-09-10 20:25 ` Linus Torvalds
2013-09-10 21:51 ` Josh Boyer
2013-09-11 1:48 ` Waiman Long
2013-09-11 3:22 ` Linus Torvalds
2013-09-11 3:56 ` Al Viro
2013-09-11 4:12 ` Linus Torvalds
2013-09-10 18:43 ` Al Viro [this message]
2013-09-10 19:01 ` Linus Torvalds
2013-09-10 19:13 ` Al Viro
2013-09-10 19:27 ` Linus Torvalds
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=20130910184324.GY13318@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Waiman.Long@hp.com \
--cc=jwboyer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=moneta.mace@gmail.com \
--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