public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [pre 3.16-rc1] Oops at spin_trylock(&inode->i_lock)
Date: Wed, 11 Jun 2014 17:01:33 +0100	[thread overview]
Message-ID: <20140611160133.GX18016@ZenIV.linux.org.uk> (raw)
In-Reply-To: <201406112035.ADB51545.QFVMLJOtFOHSOF@I-love.SAKURA.ne.jp>

On Wed, Jun 11, 2014 at 08:35:44PM +0900, Tetsuo Handa wrote:
> I also confirmed that the command line which triggers this oops is
> 
>   mount -n -o ro,remount sysfs /sys
> 
> in /etc/init.d/halt script in CentOS 6.5.
> Manually executing the command line from login shell triggers this oops.
> 
> I don't know why but commit 59a3d4c363 revealed a refcount bug
> in sysfs (or maybe in vfs)?

Try to check if this helps:

diff --git a/fs/dcache.c b/fs/dcache.c
index be2bea8..e99c6f5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -532,10 +532,12 @@ static inline struct dentry *lock_parent(struct dentry *dentry)
 	struct dentry *parent = dentry->d_parent;
 	if (IS_ROOT(dentry))
 		return NULL;
+	if (unlikely((int)dentry->d_lockref.count < 0))
+		return NULL;
 	if (likely(spin_trylock(&parent->d_lock)))
 		return parent;
-	spin_unlock(&dentry->d_lock);
 	rcu_read_lock();
+	spin_unlock(&dentry->d_lock);
 again:
 	parent = ACCESS_ONCE(dentry->d_parent);
 	spin_lock(&parent->d_lock);

  reply	other threads:[~2014-06-11 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 12:04 [pre 3.16-rc1] Oops at spin_trylock(&inode->i_lock) Tetsuo Handa
2014-06-10 14:34 ` Paul E. McKenney
2014-06-11 11:35   ` Tetsuo Handa
2014-06-11 16:01     ` Al Viro [this message]
2014-06-12 11:39       ` Tetsuo Handa

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=20140611160133.GX18016@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --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