Re: [PATCH] cowlinks v2

Jamie Lokier
2004-03-29T12:39:30Z

Eric W. Biederman wrote:
> The file will become a cow file only after it is modified or it's
> containing directory is modified.

Eh? The file (or directory) must be labelled as a cowlinked file the
moment you make the cowlink, not when the data is modified. It's
_breaking_ the cowlink that happens when the data (or directory
contents) are modified.

> Thus you can have data in the
> file that was written after the snapshot operation finished, but
> before the individual file itself is marked cow.

The creation of a cowlink should be atomic w.r.t. writing.

Specifically, the operation which moves the contents of a non-cowlink
inode to a newly created shared inode, and converts the original
non-cowlink inode to a cowlink inode, should be atomic.

Is there an unavoidable race condition? I don't see one.

-- Jamie