mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ian Kent <ikent@redhat.com>,
	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: Fri, 16 Nov 2012 17:34:15 +0000	[thread overview]
Message-ID: <20121116173415.GA16916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFz+JUthf-HAdYLzQH=r0niB4+X1ymn5egLpdhiptYXr7w@mail.gmail.com>

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?

  reply	other threads:[~2012-11-16 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16  4:15 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 [this message]
2012-11-17  2:29         ` Ian Kent

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=20121116173415.GA16916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=autofs@vger.kernel.org \
    --cc=ikent@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

Powered by JetHome