Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600Ab2KPReV (ORCPT ); Fri, 16 Nov 2012 12:34:21 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:34221 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981Ab2KPReS (ORCPT ); Fri, 16 Nov 2012 12:34:18 -0500 Date: Fri, 16 Nov 2012 17:34:15 +0000 From: Al Viro To: Linus Torvalds Cc: Ian Kent , Kernel Mailing List , autofs mailing list , linux-fsdevel Subject: Re: [PATCH] autofs4 - use simple_empty() for empty directory check Message-ID: <20121116173415.GA16916@ZenIV.linux.org.uk> References: <20121116041523.18624.46918.stgit@perseus.themaw.net> <1353083773.2332.40.camel@perseus.themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1382 Lines: 29 On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote: > On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent wrote: > > > > Sure, are you recommending I alter the fs/libfs.c functions to add a > > function that doesn't have the outer lock, and have simple_empty() call > > that, then use it in autofs? > > Yup. That's the standard pattern, although usually we *strive* to make > the unlocked versions be static to the internal code, and then use > them there for the various helpers. In your case that seems > impossible, since you do depend on holding the d_lock in the caller > after the tests. But at least we don't have to duplicate the code and > have it in two unrelated places. > > Al? Comments? The thing is, I'm not convinced we really need ->d_lock held downstream. E.g. __autofs4_add_expiring() ought to be OK with just sbi->lookup_lock. Not sure about the situation in autofs4_d_automount() - the thing is messy as hell ;-/ Ian, do we really need that __simple_empty() variant in either caller? What is getting protected by ->d_lock after it and do we really need ->d_lock continuously held for 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/