On Fri, Oct 16, 2015 at 05:25:44AM -0700, Christoph Hellwig wrote:
On Fri, Oct 16, 2015 at 07:49:19AM -0400, Chris Mason wrote:
quoted
quoted
Yes, that would be my preference. I'd also like to understand what
exactly btrfs does in fallocate.
For which part? The answer changes based on how many references there
are to a given fallocated region.
Both cases. With btrfs allocating new block on every write how do you
avoid that ENOSPC? Is there a unassigned block preallocation that's
made persistent in some way?
So:
fallocate 1g -> foo
reflink foo foo2
We've now implicitly doubled the size of the fallocate, but at reflink
time btrfs doesn't account for the doubling. It's actually much
better in this case to just use a hole because neither foo or foo2 can
use the preallocated space until the 1g is fully unshared.
When we're doing writes, it'll check the preallocated extents for extra
refs and force COW if any exist. So writes into a preallocated region
can enospc.
-chris