[Unionfs] whiteouts and object removal inconsistency
Bharata B Rao
bharata.rao at gmail.com
Wed Aug 22 04:30:50 EDT 2007
Hi Josef/Erez,
In Unionfs with ODF, since you have the concept of per-union whiteout,
the removal of objects from unions is not shared IIUC. But when trying
out the ODF patch, I hit upon a few cases which appear inconsistent to
me.
Consider 2 directories a/ and b/ with a file in each of them.
#ls a/
top
#ls b/
bottom
Let these two be union mounted at union1/ and union2/ separately with
a/ being the topmost branch in both. Here a/ is mounted rw and b/ is
mounted ro.
(mount -t unionfs -o odf=/odf/odf1,dirs=a=rw:b=ro none union1
mount -t unionfs -o odf=/odf/odf2,dirs=a=rw:b=ro none union2)
Case 1: removal of 'bottom' in b/ from union1/
In this case a whiteout gets created for 'bottom' under union1(in ODF
i,e.,) and subsequently it becomes invisible from union1/ (as
expected).
But the removed file continues to be visible from union2/ as the
whiteout is per-union and union2/ doesn't know about the whiteout that
got created in union1/
Case 2: removal of 'top' in a/ from union1/
In this case, 'top' gets removed from the underlying filesystem itself
as a/ is a rw topmost layer. This makes 'top' to go away from union2/
also.
So in the first case, the removal of an object from a union didn't
affect the other union. But in the second case, it did. Isn't this
behavior inconsistent if we look at 'top' and 'bottom' just as files
in the union instead of thinking them as files lying in different
layers of the union ? So is this the expected behavior ? If so how do
you explain this seemingly inconsistent behavior ?
Case 3: removal from rw lower layer
Consider the same scenario as above, but the lower layer(b) is mounted
rw instead of ro in both the unions. Now the removal of file 'bottom'
from union1/ gets effected on the underlying filesystem itself and
hence gets reflected in union2 also. So again this is not consistent
with the behavior in Case 1.
Have you tried to define all such use cases and the expected behavior
somewhere ?
Regards,
Bharata.
--
"Men come and go but mountains remain" -- Ruskin Bond.
More information about the unionfs
mailing list