From patchwork Thu Jul 12 22:40:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1192991 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0452D3FDAE for ; Thu, 12 Jul 2012 23:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161764Ab2GLWkM (ORCPT ); Thu, 12 Jul 2012 18:40:12 -0400 Received: from fieldses.org ([174.143.236.118]:53157 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161705Ab2GLWkJ (ORCPT ); Thu, 12 Jul 2012 18:40:09 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1SpS3M-0006el-M3; Thu, 12 Jul 2012 18:40:08 -0400 Date: Thu, 12 Jul 2012 18:40:08 -0400 From: "J. Bruce Fields" To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: DCACHE_DISCONNECTED use in try_to_ascend/d_kill Message-ID: <20120712224008.GF24162@fieldses.org> References: <20120712222849.GE24162@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120712222849.GE24162@fieldses.org> 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 On Thu, Jul 12, 2012 at 06:28:49PM -0400, bfields wrote: > I've been trying to figure out if we can pare down DCACHE_DISCONNECTED > uses to only those required by exportfs, and ran across this one. There's also one DCACHE_DISCONNECTED use in fs/nfs/dir.c that I was hoping could be eliminated. It was added by Al with d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f. It looks totally theoretical to me (nfs isn't exportable, hence shouldn't see DCACHE_DISCONNECTED dentries), but maybe I'm missing something. At a minimum maybe we could pull a comment out of Al's commit?: --b. --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index f430057..b96c687 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1194,6 +1194,12 @@ out_zap_parent: /* If we have submounts, don't unhash ! */ if (have_submounts(dentry)) goto out_valid; + /* + * We can't d_drop the root of a disconnected tree: + * its d_hash is on the s_anon list and d_drop() would hide + * it from shrink_dcache_for_unmount(), leading to busy + * inodes on unmount and further oopses. + */ if (dentry->d_flags & DCACHE_DISCONNECTED) goto out_valid; shrink_dcache_parent(dentry);