Subject: Re: [vserver] Hashify and exclude
From: "Michael S. Zick" <mszick@morethan.org>
Date: Mon, 27 Oct 2008 10:22:47 -0500

On Mon October 27 2008, Ed W wrote:
> 
> >> What is the argument against unifying everything? 
> >>     
> >
> > on recente kernels (i.e. in the presence of
> > CoW Link Breaking), the only case where a
> > unified file might not work is when some
> > application checks the file properties and
> > requires them to have a link count of 1
> >  
> 
> 
> Subtle extra one, but as I understand it, the COW stuff breaks ALL
> hardlinks on write, so if you have a bunch of hard links within the
> vserver for some internal process, then additionally hardlinking those
> *across* vservers will cause all the hardlinks (even within the vserver)
> to be broken if the file is ever altered.  This may or may not be a
> problem in general (seems like a corner case for most people?)
>

It does not work that way here (2.6.27.4+vs2.3)

I am using CoW to detect changes to files in replicated development trees -
Given a file (inode) with 8 (upto 4000+ in my experience) different appearances
in the directory tree - 

Changing it creates one, total of (2) inodes, one with a link count of 7 and 
the changed one with a link count of 1.

> Herbert - when I quickly looked at the code for the unification utility,
> it *appeared* to be figuring out whether a file already is hardlinked. 
> Would it be as straightforward as it might appear to add a test to avoid
> hardlinking files across vservers if they are already hardlinked
> *within* a vserver?
> 
> Gentoo uses hardlinks within an installation for various (good)
> reasons.  Would like to preserve these where possible
> 

Do not set +iunlink +immutable on those. CoW will ignore them.

Mike
> Cheers
> 
> Ed W
>