Yes. This needs to be true even for mixed file types. If the bottom
FS has a directory `foo/' and the top FS has a regular file `foo' and a
user does chdir("foo") he gets -ENOTDIR.
> How about a simpler approach:
> Reading a file would pull it off the topmost media that had it.
> Writing a file would write it back to the topmost RW media - even if that
> was a different media than originally held the file.
Notice the implication here: the act of mounting a FS "-o rw,trans"
makes all other FSes in the stack RO (at least effectively). This
being the case, I think it makes tons of sense to restrict "-o trans"
to only *one* RW in the stack. This restriction helps avoid all manner
of weird semantics questions and races.
> By writing to the topmost RW media, an administrator could even
> stick one last RO media on the _top_ of the stack (i.e., mounted
> last); any files in this media would automatically override any files
> on the RW media below - although one could successfully write to
> them, the OS would still use the version from the RO media on top.
> An alternate way of creating immutable files, essentially.
Hmmm, I am leaning only allowing the top FS to be RW. It would IMHO be
easier to implement. You do have a point in that mounting something RO
over a RW FS adds flexibility.
> As above, the topmost RW media.
That's why I said all other RW mounts are effectively RO.
> It logically follows that if all media are RO, the stack is also RO.
Yeah.
> > 5. The designated partition can be different for different users.
Can o' worms. A better way to get this functionality is with loopback
mounting à la AIX and others.
> > 6. Elsewhere, R/O partitions do not permit files to be modified
> > in any way, so why should it be different here.
> >
> > 7. Why can't I boot from a CD with a hard drive mounted over it,
> > and have the modifications made on the hard drive.
I vote for 7. RW means COW.
> Interesting question. Would this require some kind of
> "negative dentry" that persists as long as the union is mounted?
> Should that negative dentry be stored on the topmost writable media
> or not?
Another can o' worms. I'd avoid this one too. A file on a RO media
can be changed on the RW one (COW) but not deleted / renamed.
> For some far-in-the-future version, the concept of copy-on-read
> would be marvelous too;
Yeah, far-in-the-future.
-- Peter Samuelson <sampo.creighton.edu!psamuels>- 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/