[Bug libc/15661] posix_fallocate fallback code buggy and dangerous

carlos at redhat dot com sourceware-bugzilla@sourceware.org
Fri Jun 5 18:02:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=15661

--- Comment #13 from Carlos O'Donell <carlos at redhat dot com> ---
On 06/05/2015 12:52 PM, zlynx at acm dot org wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=15661
> 
> --- Comment #12 from Jonathan Briggs <zlynx at acm dot org> ---
> (In reply to Rich Felker from comment #8)
>> I think the XSH 2.9.7 justification is something of a cop-out, and the
>> behavior is still undesirable/QoI-issue, but at least it's arguably
>> conforming to the extent that applications should avoid depending on
>> stricter behavior.
> 
> This is definitely a cop-out and very undesirable. Absolutely no one will
> expect apparently random zero bytes to appear in their files because of calling
> posix_fallocate because the function isn't supposed to write anything to the
> file.

I think there are pros and cons to both sides. The position of consensus
among the conservative glibc developers is to leave the fallback in place
as it has been for a long time, and adjust the documentation to educate
developers on the issue. Please help us spread the word about how the
function operates and that a portable use involves synchronization.

Someone should patch the man page to talk about the fallback when using
posix_fallocate on a filesystem that doesn't implement fallocate.

Cheers,
Carlos.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list