mount behavior question.

2005-07-28 Thread Ram Pai
Summary of the question: Should the topmost mount be visible, or should the most recent mount be visible? consider the following command sequence (1) cd /mnt (2) mount --bind /usr /mnt (3) mount --bind /bin /mnt (4) mount --bind /var . after step 1, the pwd of the process is

Re: mount behavior question.

2005-07-28 Thread Miklos Szeredi
Here is a scenario with shared subtree. Sorry it is complex. mount --bind /mnt /mnt mount --make-shared /mnt mkdir -p /mnt/p mount --bind /usr /mnt/1 mount --bind /mnt /mnt/2 At this stage the mount at /mnt/2 and /mnt belong to the same pnode which means mounts under them propogate

Re: mount behavior question.

2005-07-28 Thread Ram Pai
On Thu, 2005-07-28 at 04:56, Miklos Szeredi wrote: Here is a scenario with shared subtree. Sorry it is complex. mount --bind /mnt /mnt mount --make-shared /mnt mkdir -p /mnt/p mount --bind /usr /mnt/1 mount --bind /mnt /mnt/2 At this stage the mount at /mnt/2 and /mnt

Re: mount behavior question.

2005-07-28 Thread Miklos Szeredi
step 1: mount --bind /mnt /mnt a new mount 'A' is created at /mnt step 2: mount --make-shared /mnt mounts under 'A' are made shared. But in this case there are no other mounts. So only 'A' will be made shared. step 3: mkdir -p /mnt/1

Re: mount behavior question.

2005-07-28 Thread Bryan Henderson
I don't know enough about shared subtrees to have an opinion on what should happen with those, but you fundamentally asked about a perceived weirdness in existing Linux code, and I do have an opinion on that (which is that there's no weirdness). On analysis it turns out the culprit is the

Re: mount behavior question.

2005-07-28 Thread Miklos Szeredi
I think the issue is what does mount F over directory D mean? Does it mean to mount F immediately over D, in spite of anything that might be stacked above D right now? Or does it mean to throw F onto the stack which is currently sitting over D? Your analysis assumes it's the former,

Re: mount behavior question.

2005-07-28 Thread Ram Pai
On Thu, 2005-07-28 at 12:30, Miklos Szeredi wrote: no. there is no asymmetry as such. the propogations are working the way they are meant to. But the confusion arises because of the mount lookup symantics. The reason Avantika(who is doing shared subtree testing), had this exact confusion

Re: mount behavior question.

2005-07-28 Thread Ram Pai
On Thu, 2005-07-28 at 13:35, Bryan Henderson wrote: It wouldn't surprise me if someone is depending on mount over .. But I'd be surprised if someone is doing it to a directory that's already been mounted over (such that the stacking behavior is relevant). That seems really eccentric.

Re: mount behavior question.

2005-07-28 Thread Miklos Szeredi
I am not surprised when mounts on /mnt/1 do not propogate to /mnt/2/1 This is expected, and I am perfectly happy. Because the mount is attempted on 'B' and 'B' has nobody to propogate to. when mount on /mnt/2/1 (i.e on C at dentry 1) is attempted, I expect to see a new mount 'E' at that

Re: mount behavior question.

2005-07-28 Thread Miklos Szeredi
Does it mean to mount F immediately over D, in spite of anything that might be stacked above D right now? Or does it mean to throw F onto the stack which is currently sitting over D? Your analysis assumes it's the former, whereas what Linux does is consistent with the latter.

Re: mount behavior question.

2005-07-28 Thread Bryan Henderson
Bryan, what would you expect the behavior to be when somebody mounts on a directory what is already mounted over? Well, I've tried to beg the question. I said I don't think it's meaningful to mount over a directory; that one actually mounts at a name. And that Linux's peculiar mount over '.'

Re: mount behavior question.

2005-07-28 Thread Bryan Henderson
One problem with 1) [mounting into the middle of a mount stack] is that it breaks the assumption that an 'mount X; umount X' pair is a no-op. A very good point. Since unmounts are always from the top of the stack, for symmetry mounts should be there too. Here's another tidbit of information I

Re: mount behavior question.

2005-07-28 Thread Ram Pai
On Thu, 2005-07-28 at 15:27, Bryan Henderson wrote: Bryan, what would you expect the behavior to be when somebody mounts on a directory what is already mounted over? Well, I've tried to beg the question. I said I don't think it's meaningful to mount over a directory; that one actually