From patchwork Thu Jan 13 13:22:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hooanon05@yahoo.co.jp X-Patchwork-Id: 475971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0DDVKVu020469 for ; Thu, 13 Jan 2011 13:31:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756707Ab1AMNbT (ORCPT ); Thu, 13 Jan 2011 08:31:19 -0500 Received: from mfbichi11.ns.itscom.net ([219.110.2.189]:44791 "EHLO mfbichi11.ns.itscom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498Ab1AMNbT (ORCPT ); Thu, 13 Jan 2011 08:31:19 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 13 Jan 2011 13:31:20 +0000 (UTC) X-Greylist: delayed 528 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Jan 2011 08:31:18 EST Received: from mtoichi11.ns.itscom.net ([unknown]) by mfbichi11.ns.itscom.net with ESMTP id p0DDVGBY011616 Thu, 13 Jan 2011 22:31:16 +0900 (JST) Received: from mtiichi12.ns.itscom.net ([unknown]) by mtoichi11.ns.itscom.net with ESMTP id p0DDM7c5001520 Thu, 13 Jan 2011 22:22:07 +0900 (JST) Received: from jromail.nowhere (h219-110-236-004.catv02.itscom.jp [219.110.236.4]) by mtiichi12.ns.itscom.net with ESMTP id p0DDM7iu029159 ; Thu, 13 Jan 2011 22:22:07 +0900 (JST) Received: from jro by jrobl id 1PdN7v-00027H-BU ; Thu, 13 Jan 2011 22:22:07 +0900 From: "J. R. Okajima" Subject: Re: NFS root lockups with -next 20110113 To: Mark Brown Cc: Trond Myklebust , Santosh Shilimkar , Nick Piggin , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org In-Reply-To: <20110113120626.GB30351@opensource.wolfsonmicro.com> References: <20110113120626.GB30351@opensource.wolfsonmicro.com> Date: Thu, 13 Jan 2011 22:22:07 +0900 Message-ID: <8138.1294924927@jrobl> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org diff --git a/fs/namei.c b/fs/namei.c index 5bb7588..51d052f 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -480,6 +480,7 @@ static int nameidata_dentry_drop_rcu(struct nameidata *nd, struct dentry *dentry { struct fs_struct *fs = current->fs; struct dentry *parent = nd->path.dentry; + int isroot; BUG_ON(!(nd->flags & LOOKUP_RCU)); if (nd->root.mnt) { @@ -489,18 +490,22 @@ static int nameidata_dentry_drop_rcu(struct nameidata *nd, struct dentry *dentry goto err_root; } spin_lock(&parent->d_lock); - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); - if (!__d_rcu_to_refcount(dentry, nd->seq)) - goto err; + isroot = IS_ROOT(dentry); + if (!isroot) { + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); + if (!__d_rcu_to_refcount(dentry, nd->seq)) + goto err; + } /* * If the sequence check on the child dentry passed, then the child has * not been removed from its parent. This means the parent dentry must * be valid and able to take a reference at this point. */ - BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent); + BUG_ON(!isroot && dentry->d_parent != parent); BUG_ON(!parent->d_count); parent->d_count++; - spin_unlock(&dentry->d_lock); + if (!isroot) + spin_unlock(&dentry->d_lock); spin_unlock(&parent->d_lock); if (nd->root.mnt) { path_get(&nd->root); @@ -513,7 +518,8 @@ static int nameidata_dentry_drop_rcu(struct nameidata *nd, struct dentry *dentry nd->flags &= ~LOOKUP_RCU; return 0; err: - spin_unlock(&dentry->d_lock); + if (!isroot) + spin_unlock(&dentry->d_lock); spin_unlock(&parent->d_lock); err_root: if (nd->root.mnt)