Re: [PATCH] VFS: Fix automount for negative autofs dentries

From: Christoph Hellwig
Date: Mon Jul 11 2011 - 09:41:58 EST


> + 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/