Re: [PATCH] private mounts

Jamie Lokier
2005-04-30T09:43:24Z

Miklos Szeredi wrote:
> > > How do you bind mount it from a different namespace? You _do_ need
> > > bind mount, since a new mount might require password input, etc...
> >
> > Not nessecarily. The filesystem gets called into ->get_sb for every mount,
> > and can then decided whether to return an existing superblock instance or
> > setup a new one. If the credentials for the new mount match an old one
> > it can just reuse it. (e.g. for block based filesystem it will always reuse
> > right now)
>
> And if the credentials are checked in userspace (sshfs)?

Well, if you can find a way to tell the userspace FUSE daemon to know
that the mount is being done by the same user as the existing mount,
you don't need (or want) to check the credentials - you want the FUSE
daemon to tell the kernel code which superblock to reuse.

This hack is a bit nasty - namespace per login, copying mounts
from another login's namespace - but it would work.

-- Jamie