Re: Loopback (dir->dir) mounting (NOT -o loop)

Date: Fri Jun 02 2000 - 00:22:37 EST

Chris Wedgwood wrote:
> On Thu, Jun 01, 2000 at 04:03:15PM -0700, H. Peter Anvin wrote:
> mount -t bind /home/user /home/user/again
> No it won't. /home/user/again is be empty. Try it.

I had a quick look at the code but couldn't quite figure out how
it accomplishes this, and I don't have any system running a kernel
recent enough to experiment, so I have a few perhaps silly questions:

 - shouldn't mount simply return an error in this case ?
 - what happens if I try to create things in /home/user/again ?
 - does this mechanism rule out all cases where a device can be mounted
   on a directory of the file system on that device ?

Restricting -t bind seems useful to me, unless there were already means
for a user to make nasty surprises (a la proc, NFS, devfs, etc.) appear
in their directories (except -o user, of course). E.g. an administrator
could simply backup everything underneath /export, without looking at
FS boundaries - until now. Maybe this is finally a case for MS_NOSUB.

- Werner

 / Werner Almesberger, ICA, EPFL, CH /

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:14 EST