Re: FS Unions

Alexander Viro (viro@math.psu.edu)
Tue, 15 Jun 1999 01:16:56 -0400 (EDT)


On 14 Jun 1999, Kai Henningsen wrote:

> viro@math.psu.edu (Alexander Viro) wrote on 14.06.99 in <Pine.GSO.4.10.9906140932160.22023-100000@weyl.math.psu.edu>:
>
> > * when you are looking up a directory entry for 'foo':
> > * it is looked up in the overlapping filesystem first. If
> > it is found - fine, we got it.
> > * otherwise, look for whiteout entry with that name (also
> > in overlapping fs). If found - return -ENOENT (file
> > doesn't exist).
> > * otherwise (neither normal nor whiteout entries are there)
> > look into the underlying layer.
> > * Not found there - return -ENOENT.
> > * Found and is *not* a directory - got it.
> > * Found and is a directory - create an empty directory
> > with the same name in overlapping fs.
> > * to create a directory entry:
> > * look for whiteout entry with that name (in overlapping
> > fs). If not found - just go ahead and act as for normal
> > filesystem. If we are creating a directory mark it
> > non-transparent (see below).
> > * if found and we are creating *not* a directory - remove
> > whiteout and act as for normal fs.
> > * if found and we are creating a directory - remove
> > whiteout, create a directory *and* mark it as
> > non-transparent. That is, in that directory and all its
> > subdirectories we are acting as for the usual mount - no
> > lookups into the underlying level.
> > * to remove a directory entry:
> > * if there is an entry with that name in overlapping fs
> > and nothing under it - simply remove.
> > * if there are entries both in overlapping and underlying
> > layers - replace the overlapping one with whiteout.
> > * if there is no entry in overlapping layer - create a
> > whiteout.
> > All modifications go into the overlapping fs. All you need from it is a
> > way to represent whiteouts (normally done as entries with reserved
> > inumber value).
>
> Sounds like you get into real trouble with renames, especially directory
> renames.

Anything that should lead to namespace changes on the lower layers gets
-EROFS. There is no way to make underlying files in a directory move
together with it (well, there is, but it means copying). Maybe more
reasonable approach for directories would be -EXDEV - that way userspace
utilities would be forced to make copy/remove thing. But I'm not sure that
it's the right thing to do.

-
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/