From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 00/10] dcache cleanups Date: Wed, 13 Oct 2010 11:56:37 -0400 Message-ID: <20101013155637.GA22447@infradead.org> References: <20101010093620.416498597@canuck.infradead.org> <20101013014601.GT4681@dastard> <20101013112213.GB15683@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , viro@zeniv.linux.org.uk, eparis@redhat.com, linux-fsdevel@vger.kernel.org To: Dave Chinner Return-path: Received: from canuck.infradead.org ([134.117.69.58]:40764 "EHLO canuck.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254Ab0JMP4o (ORCPT ); Wed, 13 Oct 2010 11:56:44 -0400 Content-Disposition: inline In-Reply-To: <20101013112213.GB15683@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Found the bug. I did a small cleanup after testing the patch and inverted a condition. The correct one is below: --- From: Christoph Hellwig Subject: exportfs: use dget_parent Use dget_parent instead of opencoding it. This simplifies the code, but more importanly prepares for the more complicated locking for a parent dget in the dcache scale patch series. Signed-off-by: Christoph Hellwig Index: linux-2.6/fs/exportfs/expfs.c =================================================================== --- linux-2.6.orig/fs/exportfs/expfs.c 2010-10-11 16:58:59.533088586 -0400 +++ linux-2.6/fs/exportfs/expfs.c 2010-10-13 09:54:41.070259168 -0400 @@ -74,21 +74,20 @@ static struct dentry * find_disconnected_root(struct dentry *dentry) { dget(dentry); - spin_lock(&dentry->d_lock); - while (!IS_ROOT(dentry) && - (dentry->d_parent->d_flags & DCACHE_DISCONNECTED)) { - struct dentry *parent = dentry->d_parent; - dget(parent); - spin_unlock(&dentry->d_lock); + while (!IS_ROOT(dentry)) { + struct dentry *parent = dget_parent(dentry); + + if (!(parent->d_flags & DCACHE_DISCONNECTED)) { + dput(parent); + break; + } + dput(dentry); dentry = parent; - spin_lock(&dentry->d_lock); } - spin_unlock(&dentry->d_lock); return dentry; } - /* * Make sure target_dir is fully connected to the dentry tree. *