Re: silent semantic changes with reiser4

Linus Torvalds
2004-08-26T18:27:01Z

On Thu, 26 Aug 2004, Jamie Lokier wrote:
>
> > .. but even if it did that, it should use O_DIRECTORY when it did so. If
> > it doesn't, it's broken.
>
> Didn't someone just say that O_DIRECTORY will succeed on a device,
> precisely because opendir() is supposed to succeed on the device?

It will succeed on the _name_ of the device, but it won't open the device
node. It would open the _directory_ node associated with that name.

Think of it this way: a pathname always points to one "container". That
container is either a directory or a single node - and O_DIRECTORY ends up
being the thing that chooses between them.

> > I don't think you can do that. The kernel has no idea how to mount the
> > filesystem.
>
> It is not the kernel which decides. The filesystem containing
> /dev/hda/part1 opens "the directory branch".

But that filesystem cannot know what the _other_ filesystem configurations
are. And that's what you'd have to have to mount.

> The obvious implementation has the userspace helper just mounting it,
> end of story. If the mount command fails, it fails. Much like autofs.

Yes, that would work, but it's of questionable use. If you want autofs,
then just _use_ autofs.

Linus