On Sunday 23 November 2008 09:01:35 Denys Vlasenko wrote:
> On Friday 07 November 2008 03:01, [EMAIL PROTECTED] wrote:
> > busybox's implementation of mount differs from the standalone version

Back in the 1.1 timeframe I rewrote it more or less from scratch, something 
like 3 times, trying to get it to behave sanely.  (Mount is tricksy.)

I see it's been fairly heavily edited then.  Kind of horrible to read through 
now, actually.  And kind of broken in several places.  Ooh, ick.

> >  ==> sudo mount -a -v
> > mount: proc already mounted on /proc
> > mount: UUID=79f04f7c-1d73-45a4-b996-5a1e88c2127e already mounted on /boot
> > mount: tmpfs already mounted on /var/tmp
> > nothing was mounted
> >
> > Is this a bug or intentional?
>
> It is not intentional.

I could talk about how the kernel's semantics for what mount actually does 
have changed rather a lot since 2.4.  (Anybody remember when you couldn't 
mount the same filesystem in two places at once?  Before they let mounts share 
superblock instances?)

> However, I'd find it difficult to formulate exact logic
> how mount -a should behave if *some* of mounts are already
> done.

The tricky one is that you have to overmount / to switch_root off of rootfs, 
so you can't simply say "this mount point is already in use".

The rule should probably be more like "If existing mount has same filesystem 
type as the new one you're trying to do, bail out".  Except this won't work if 
you try each block-backed type in /proc/filesystems in sequence autodetect 
your mount point (which is the only sane way to do it; the kernel knows what 
filesystems it supports, a userspace tool doesn't).  Luckily, for tmpfs you 
_must_ specify the type (either via -t or saying it in fstab), and that's the 
one we really care about here.

> Might get real weird in corner cases of stacked mounts,
> union mounts, mounts with some options differing and so on.

Some filesystem types are per-instance, and some are shared with all instances 
(most block backed ones, non-containerized versions of /proc and /sys...).

Did you ever read the thing I wrote about the four types of filesystems 
(blocked back, ram backed, synthetic, and network)?

Rob
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to