Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbbGMCas (ORCPT ); Sun, 12 Jul 2015 22:30:48 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39502 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbbGMCaq (ORCPT ); Sun, 12 Jul 2015 22:30:46 -0400 X-Sasl-enc: JxaeQXonqAxRn+CmrPdCoQtOtB2hJKqyFvxItIo9Ouea 1436754635 Message-ID: <1436754625.2855.9.camel@pluto.fritz.box> Subject: Re: [RFC] freeing unlinked file indefinitely delayed From: Ian Kent To: Al Viro Cc: Linus Torvalds , "J. Bruce Fields" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Mon, 13 Jul 2015 10:30:25 +0800 In-Reply-To: <20150712151729.GK17109@ZenIV.linux.org.uk> References: <20150708014237.GC17109@ZenIV.linux.org.uk> <1436440655.2709.8.camel@pluto.fritz.box> <1436441204.2709.10.camel@pluto.fritz.box> <20150712151729.GK17109@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 48 On Sun, 2015-07-12 at 16:17 +0100, Al Viro wrote: > On Thu, Jul 09, 2015 at 07:26:44PM +0800, Ian Kent wrote: > > > But the dentrys that will most likely face summary execution will be > > > hashed, such as was the case on that 2.6.32 kernel at dput(). > > > > > > Doesn't that mean that something dropped the dentry after the dput(), > > > that will now also free the dentry, that took the refcount to 0? > > > > Oh wait, think I get it now ... perhaps it's prune_one_dentry() doing > > it ... > > What, unhashing? Yes, it does. Yep, that was what I was thinking at the time. > > A bit of context - the breakage that had first pointed in direction of > this bug had been a deadlock with dcache shrinker run on frozen fs was > stumbling across a hashed dentry with zero refcount *and* zero link count > of its inode, triggering its eviction, final iput(), inode freeing and > deadlock on attempt to do sb_start_intwrite() there; figuring out how could > such a dentry appear in the first place had uncovered this fun. Which > a) is a bug in its own right and > b) happens in mainline as well. I get all of that, and it sure does look like these things should be treated as unhashed. My puzzle is the life cycle of DCACHE_DISCONNECTED dentrys, which is mostly unrelated. Not to worry, this isn't the first time I've been defeated trying to work it out. The only way I can see disconnected dentrys created (possibly unhashed, and maybe not materialized) is via nfs and nfsd, beside the usage mentioned here of course. There must be some indirection I'm missing wrt. export_operations usage .... Ian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/