Re: [RFC] union-mount stuff

From: Alexander Viro (viro@math.psu.edu)
Date: Wed Jun 07 2000 - 04:02:33 EST


On Wed, 7 Jun 2000 almesber@lrc.di.epfl.ch wrote:

> > /foo/bar. We do chdir("/foo/bar"), what should become busy? Variants:
> > mountpoint, first element, last element, all of them.
>
> Do you mean the general case, if pathU into a unionfs corresponds to
> path1...pathN in unionfs elements, what should become busy, or specificly
> only mount points ? For the general case, I'd say as little as possible,
> e.g. if the unionfs can collapse enough state into its own structures to
> to provide meaningful semantics (including things like ..), it shouldn't
> keep its elements busy.

union-mount != unionfs. They are independent and just happen to produce
similar effect in the root. unionfs is copy-on-write beast atop of the
read-only filesystem. union-mount glues roots and nothing else. OTOH, you
can use the same fs in many unions - impossible with any reasonable
stacking.

> > C) we start with the normal mount and union-mount something else.
> > Question: what is the desired result (almost definitely the set of old and
> > new mounted stuff) and who should become busy?
>
> Hmm, how do you construct a unionfs ? By layering elements on top of an
> existing directory ? Or by mounting the whole package ?

mount -o union [-a|-n|] {normal mount arguments}

> > D) In the cases above, what do we want to get from stat(2)?
>
> st_nlink = `expr 1 + \`find . -type d -maxdepth 1 | wc -l\``
> Was this the question ? ;-)

Nope. Look: we mount /dev/sda7 and /dev/fd0 atop of /mnt. Who should be
reported as owner? Owner of /mnt of root filesystem? Owner of / on
/dev/sda7? Owner of / on /dev/fd0? Notice that they may easily be all
different.

> > Frankly, I'm sorely tempted to say that cd to mountpoint always
> > makes the mountpoint busy and leaves the mounted fs alone.
>
> Seems that this could cause problems with pivot_root. Or would
> cd /dir be different from cd /dir. ? (Nasty, if you ask me.)

Negative and negative. What problems with pivot_root()? It will simplify
the thing...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



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