overlay filesystem: request for inclusion (v16)
Sorry for being so very late to the party, but rather than messing with xattrs, why not just have a specific file (say, default /.whiteout, but selectable via a mount option) and links to it are counted as whiteout entries?
All you need to do is resolve the link (it's probably a good idea to allow symlinks to avoid hard-link count limits) and compare the fs and inode number.
It's kind of hackish, but it could be done on pretty much *any* Unix file system. VFAT would be SOL, but that's probably acceptable.
(Any security options on mount point crossing or consistent ownership of symlinks that you want to impose would probably be of general VFS use, and again, not FS-specific.)
Al Viro
maintainerQuoted 9 lines · George Spelvin
Sorry for being so very late to the party, but rather than messing with xattrs, why not just have a specific file (say, default /.whiteout, but selectable via a mount option) and links to it are counted as whiteout entries?
All you need to do is resolve the link (it's probably a good idea to allow symlinks to avoid hard-link count limits) and compare the fs and inode number.
Quoted 6 lines
It's kind of hackish, but it could be done on pretty much *any* Unix file system. VFAT would be SOL, but that's probably acceptable.
(Any security options on mount point crossing or consistent ownership of symlinks that you want to impose would probably be of general VFS use, and again, not FS-specific.)
Yeah... Now, think what rm -rf foo/ would be doing. We read the underlying directory. For each file in it we create a link to that magical file of yours in covering one. _Then_ we do rmdir(), and what a joy it turns out to be - we
* lock the covering directory
* read the covering directory and stat everything in it, checking that
it's a link to your file; we also read the underlying directory and verify that everything in it has a matching whiteout in the covering one.
* once we are through, we read it *again*, this time doing unlinks
and praying real hard we won't crash in the meanwhile
* once that is finished, we finally can rmdir the fucker and unlock
its inode.
I'm sorry, but this is insane.
Quoted 4 lines · George Spelvin
Sorry for being so very late to the party, but rather than messing with xattrs, why not just have a specific file (say, default /.whiteout, but selectable via a mount option) and links to it are counted as whiteout entries?
Don't the ext2 descendants have an array of reserved inodes at the beginning (one of which is the journal for ext3, most of which were still unused last I checked)?
Maybe ext4 optimized this away, but that would mean it doesn't have to be anywhere in the namespace.
(Of course you'd have to teach fsck about it, and probably not update the link count or you'll have contention and integer overflow...)
Rob