Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751177AbbGLPAo (ORCPT ); Sun, 12 Jul 2015 11:00:44 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:56371 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbGLPAn (ORCPT ); Sun, 12 Jul 2015 11:00:43 -0400 Date: Sun, 12 Jul 2015 16:00:35 +0100 From: Al Viro To: Ben Myers Cc: Linus Torvalds , "J. Bruce Fields" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC] freeing unlinked file indefinitely delayed Message-ID: <20150712150035.GJ17109@ZenIV.linux.org.uk> References: <20150708014237.GC17109@ZenIV.linux.org.uk> <20150708154143.GG4015@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150708154143.GG4015@sgi.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 17 On Wed, Jul 08, 2015 at 10:41:43AM -0500, Ben Myers wrote: > The bug rings a bell for me so I will stick my neck out instead of > lurking. Don't you need to sample that link count under the filesystems > internal lock in order to avoid an unlink/iget race? I suggest creating > a helper to prune disconnected dentries which a filesystem could call in > .unlink. That would avoid the risk of unintended side effects with the > d_alloc/d_free/icache approach and have provable link count correctness. For one thing, this patch does *not* check for i_nlink at all. For another, there's no such thing as 'filesystems internal lock' for i_nlink protection - that's handled by i_mutex... And what does iget() have to do with any of that? -- 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/