[Unionfs] Re: unionfs, cow, and whiteout

Paul Albrecht albrecht at rdi1.com
Thu Jan 17 10:31:33 EST 2008


On Wed, 2008-01-16 at 18:27 -0500, Gregory Haskins wrote:
> Erez Zadok wrote:
> > [I recommend we direct future discussions in this thread to the unionfs
> > ML. -ezk]
> 
> (Note I am not subscribed to unionfs ML, so please include me in CC)
> 
> > Paul, you're looking into a specific 2-branch configuration where one branch
> > is r-o and the other is r-w.  Yes, in that specific case, one could argue
> > that a whiteout isn't needed.  But what if I have N branches, with a mix of
> > rw/ro branches, where a file or its whiteout could exist in any branch?  If
> > I don't create a whiteout, then I have to scan all N branches and remove the
> > same file from there (assuming the file doesn't exist on a r-o branch --
> > then I have to abort).
> 
> 
> I wonder if there is a way to track which files were created in a branch 
> vs promoted to a branch?  If so, wouldn't only files in the promoted 
> class then require a whiteout file?  I have no idea if this is plausible 
> with the unionfs architecture, but it would address Paul's concern.
> 
> For instance, what if you created a shadow/hidden ".cow" file when this 
> promotion occurs, and then rename it to the whiteout file if it gets 
> deleted.  Files without a .cow shadow file simply get deleted without 
> any extra action.  Files with a .cow shadow file delete the local branch 
> copy and rename the .cow to the whiteout.
> 

The problem with this approach is it pollutes the name space of the cow
layer with a bunch of hidden files that really aren't needed which is
what I was objecting to in the first place.

Checking the lower layers of the union mount for the file name to
determine whether the whiteout is required seems to make more sense,
that is, if the file exists in lower layers generate a whiteout in the
cow layer otherwise simply delete the file.

> Just a thought.
> 
> Regards,
> -Greg
> 
-- 

Paul Albrecht


More information about the unionfs mailing list