From patchwork Fri Dec 3 22:33:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 379221 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 oB3MXVYt006871 for ; Fri, 3 Dec 2010 22:33:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025Ab0LCWda (ORCPT ); Fri, 3 Dec 2010 17:33:30 -0500 Received: from fieldses.org ([174.143.236.118]:47111 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580Ab0LCWd3 (ORCPT ); Fri, 3 Dec 2010 17:33:29 -0500 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1POeBz-0007x8-BK; Fri, 03 Dec 2010 17:33:27 -0500 Date: Fri, 3 Dec 2010 17:33:27 -0500 From: "J. Bruce Fields" To: Alexander Viro Cc: Nick Piggin , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH] nfsd4: allow __d_obtain_alias() to return unhashed dentries Message-ID: <20101203223326.GB28763@fieldses.org> References: <20101112184353.GA32745@fieldses.org> <20101115174837.GB10044@fieldses.org> <20101129193248.GA9897@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 22:33:32 +0000 (UTC) diff --git a/fs/dcache.c b/fs/dcache.c index 23702a9..afa8a0d 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -368,7 +368,7 @@ static struct dentry * __d_find_alias(struct inode *inode, int want_discon) next = tmp->next; prefetch(next); alias = list_entry(tmp, struct dentry, d_alias); - if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { + if (S_ISDIR(inode->i_mode) || !inode->i_nlink || !d_unhashed(alias)) { if (IS_ROOT(alias) && (alias->d_flags & DCACHE_DISCONNECTED)) discon_alias = alias;