Re: [PATCH] cowlinks v2

From: Patrick J. LoPresti
Date: Mon Mar 29 2004 - 16:08:03 EST

Pavel Machek <pavel@xxxxxx> writes:

> > > What happens if the disk fills while you are making the copy? Will
> > > open(2) on an *existing file* then return ENOSPC?
> Applications can not be sure that it is existing file. If you
> do stat followed by open, someone may have removed the file in
> between. So it is not so new case.

I should have said, "Will open(2) without O_CREAT then return ENOSPC?"

This is definitely a new case.

For what it's worth, I agree with whoever (Jamie?) said that COW
should be primarily a space optimization, and that semantically the
two files should mostly behave like separate copies.

In fact, I think it is unfortunate, in some ways, that things like
permissions and timestamps are kept in the inode. This means that two
files may only be COW-linked if they also share ownership,
permissions, and timestamps, which makes COW links less useful for
some applications (e.g., sharing source trees among multiple

But sharing data blocks without sharing inodes is too horrible even to
contemplate, I suppose.

- Pat
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at