From: Steven Rostedt <rostedt@goodmis.org>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: LKML <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>,
Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH][v3.2 stable tree] dcache: Balance rcu_read_lock in have_submounts()
Date: Thu, 12 Feb 2015 00:28:50 -0500 [thread overview]
Message-ID: <20150212002850.146cf455@grimm.local.home> (raw)
In-Reply-To: <1423624537.2349.164.camel@decadent.org.uk>
On Wed, 11 Feb 2015 03:15:37 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:
> I've reviewed locking contexts in all three functions that I changed
> when backporting "deal with deadlock in d_walk()". It's actually worse
> than you say:
>
> - We don't hold this_parent->d_lock at the 'positive' label in
> have_submounts(), but it is unlocked after 'rename_retry'.
> - There is an rcu_read_unlock() after the 'out' label in
> select_parent(), but it's not held at the 'goto out'.
>
> Does the following patch work for you?
I booted the original 3.2 kernel 3 times and it succeeded once, and
crashed the other two.
I applied this patch and booted it 5 times, and it succeeded every time.
I removed the patch, and it crashed on the very next boot.
Thus, I'd say it seems to have fixed the issue for me.
Tested-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
>
> Ben.
>
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -1035,7 +1035,7 @@ ascend:
> return 0; /* No mount points found in tree */
> positive:
> if (!locked && read_seqretry(&rename_lock, seq))
> - goto rename_retry;
> + goto rename_retry_unlocked;
> if (locked)
> write_sequnlock(&rename_lock);
> return 1;
> @@ -1045,6 +1045,7 @@ rename_retry:
> rcu_read_unlock();
> if (locked)
> goto again;
> +rename_retry_unlocked:
> locked = 1;
> write_seqlock(&rename_lock);
> goto again;
> @@ -1109,6 +1110,7 @@ resume:
> */
> if (found && need_resched()) {
> spin_unlock(&dentry->d_lock);
> + rcu_read_lock();
> goto out;
> }
>
> --- END ---
>
next prev parent reply other threads:[~2015-02-12 5:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 15:38 Steven Rostedt
2015-02-11 3:15 ` Ben Hutchings
2015-02-12 5:28 ` Steven Rostedt [this message]
2015-02-16 0:03 ` Ben Hutchings
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=20150212002850.146cf455@grimm.local.home \
--to=rostedt@goodmis.org \
--cc=ben@decadent.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--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
all inboxes | Powered by JetHome®