[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9500: [PATCH]: use posix_fallocate where supported

From: Goswin von Brederlow
Subject: bug#9500: [PATCH]: use posix_fallocate where supported
Date: Sat, 26 Nov 2011 04:55:08 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE)

Pádraig Brady <address@hidden> writes:

> On 11/25/2011 10:13 AM, Pádraig Brady wrote:
>> Hmm, one of your points above got me thinking.
>> Might fallocate() fail to allocate an extent with ENOSPC,
>> but there could be fragmented space available to write()?
>> That would scupper benefit (2) above :(
>> I'll ask address@hidden
> And the response from there is that fallocate() will
> check the free blocks first, and then try to allocate
> as a contiguous extent, but that part is not guaranteed.
> So we still get benefit (2).
> cheers,
> Pádraig.

Don't forget that a sparse file uses less space than its size. So any cp
mode that checks for zero filled blocks and omits them on the
destination might use less blocks than the source uses or than the
fiemap indicates.

So cp can only fail on ENOSPC from fallocate() if it does not skip zero
filled blocks. I.e. when --sparse=never or --sparse=auto doesn't detect
a sparse file. But that is quite often the case.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]