Subject: Re: union whiteouts persistence intentional?
To: Chapman Flack <nblists@anastigmatix.net>
From: theo borm <theo4490@borm.org>
List: tech-kern
Date: 06/07/2006 02:23:50
Chapman Flack wrote:

> theo borm wrote:
>
>> Whiteouts seem to be persistent entries in the overlaying directory,
>> surviving the union being unmounted again, and I'm not quite sure
>
>
> I can't think of a good way to make them nonpersistent and still have
> them be useful ... if you have a union set up in /etc/fstab you probably
> want it to look the same way after your next reboot.

I hadn't thought of it that way. And I'm not quite sure if it works
that way. In fstab you can give -o union to mounts, but this doesn't
(AFAIK) support whiteouts at all; deleting files that are nonexistent
in the topmost layer will really delete the file from the underlying
layer, piercing a hole in the "protection" that the "-o union" mounted
layer seemed to have

example: start with two dirs again
# ls -R
one  over
./one:
test
./over:
test

use the union mount option to mount "over" over "one"
# mount_null -o union over one

delete file from "one" and see what gets deleted:
# rm one/testl ls -R
one  over
./one:
test
./over:

->  only the file from the overlay disappears - no whiteout in "one"

delete file from "one" and see what gets deleted:
# rm one/testl ls -R
one  over
./one:
./over:

-> both files gone - overlay pierced.

>
> But would rm -W be a faster way to get rid of them when you don't
> want them?

Then I should still know their names. I cant just do rm -W * can I?

I don't like the idea of directory entries that I can't see and can't delete
unless I know their full path name.

Most usefull behaviour to me would be something like a mount option
"-o non-persistent-whiteouts", but I guess this would require one to
actively clean up behind one during unmount (and what if a union is
not properly unmounted?)


>
> -Chap