From: Ian Kent <ikent@redhat.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	autofs mailing list <autofs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] autofs4 - use simple_empty() for empty directory check
Date: Sat, 17 Nov 2012 10:29:01 +0800	[thread overview]
Message-ID: <1353119341.2338.1.camel@perseus.themaw.net> (raw)
In-Reply-To: <20121116173415.GA16916@ZenIV.linux.org.uk>
On Fri, 2012-11-16 at 17:34 +0000, Al Viro wrote:
> On Fri, Nov 16, 2012 at 08:43:28AM -0800, Linus Torvalds wrote:
> > On Fri, Nov 16, 2012 at 8:36 AM, Ian Kent <ikent@redhat.com> 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?
Yeah, I've thought about that a few times now but haven't gone so far as
to change it.
I'll have another look.
Ian
     prev parent reply	other threads:[~2012-11-17  2:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16  4:15 [PATCH] autofs4 - use simple_empty() for empty directory check Ian Kent
2012-11-16 15:45 ` Linus Torvalds
2012-11-16 16:36   ` Ian Kent
2012-11-16 16:43     ` Linus Torvalds
2012-11-16 17:34       ` Al Viro
2012-11-17  2:29         ` Ian Kent [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=1353119341.2338.1.camel@perseus.themaw.net \
    --to=ikent@redhat.com \
    --cc=autofs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).