[PATCH 4/4] Remove broken posix_fallocate, posix_falllocate64 fallback code [BZ#15661]

Florian Weimer fweimer@redhat.com
Mon May 18 13:14:00 GMT 2015


On 05/07/2015 09:05 PM, Florian Weimer wrote:
> On 05/07/2015 08:19 PM, Roland McGrath wrote:
>>> If I'm not mistaken ftruncate could still reduce the file size if it
>>> races with another operation that would extend the file. This is also
>>> a data loss bug.
>>
>> I concur.
> 
> It happens with length == 0.  We could error out with EINVAL instead of
> calling ftruncate.
> 
> Daniel Berrange pointed me to these bugs:
> 
>   https://sourceware.org/bugzilla/show_bug.cgi?id=17322
>   https://bugzilla.redhat.com/show_bug.cgi?id=1140250
>   https://bugzilla.redhat.com/show_bug.cgi?id=1077068

Another very recent example is here:


https://lists.fedorahosted.org/pipermail/elfutils-devel/2015-May/004868.html

> This suggests that people actually rely on the current allocation
> behavior.  Combined with my previous analysis that applications will
> start to fail if we remove the fallback and return EINVAL, I now think
> we need to keep the allocation loop.

This is the patch I currently have.  It fixes the avoidable bugs.  I
still think we are in a bad situation here, that even a compatibility
symbol cannot fix.

-- 
Florian Weimer / Red Hat Product Security
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-posix_fallocate-Emulation-fixes-and-documentation-BZ.patch
Type: text/x-patch
Size: 13278 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150518/26011934/attachment.bin>


More information about the Libc-alpha mailing list