linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: viro@ZenIV.linux.org.uk, autofs@linux.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ian Kent <raven@themaw.net>
Subject: Re: [PATCH] VFS: Fix automount for negative autofs dentries
Date: Mon, 11 Jul 2011 09:41:47 -0400	[thread overview]
Message-ID: <20110711134147.GA6853@infradead.org> (raw)
In-Reply-To: <20110711132057.14641.36229.stgit@warthog.procyon.org.uk>

> +	if (!(flags & LOOKUP_FOLLOW)) {
> +		/* We do, however, want to mount if someone wants to open or
> +		 * create a file of any type under the mountpoint, wants to
> +		 * traverse through the mountpoint or wants to open the mounted
> +		 * directory.
> +		 */
> +		if (flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
> +			     LOOKUP_OPEN | LOOKUP_CREATE))
> +			goto need_automount;
> +
> +		/* Also, autofs may mark negative dentries as being automount
> +		 * points.  These will need the attentions of the daemon to
> +		 * instantiate them before they can be used.
> +		 */
> +		if (!path->dentry->d_inode)
> +			goto need_automount;
>  		return -EISDIR;
> +	}
> +need_automount:

That's some really odd code structure.

	if (!(flags & (LOOKUP_FOLLOW | LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
		        LOOKUP_OPEN | LOOKUP_CREATE)) &&
	    path->dentry->d_inode)
		return -EISDIR;

would do the same.

  reply	other threads:[~2011-07-11 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11 13:20 [PATCH] VFS: Fix automount for negative autofs dentries David Howells
2011-07-11 13:41 ` Christoph Hellwig [this message]
2011-07-11 14:13 ` David Howells
2011-07-11 15:24   ` Christoph Hellwig

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=20110711134147.GA6853@infradead.org \
    --to=hch@infradead.org \
    --cc=autofs@linux.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --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).