This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18515] posix_fallocate disastrous fallback behavior is no longer mandated by POSIX and should be fixed


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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |fweimer at redhat dot com
         Resolution|---                         |WONTFIX
              Flags|                            |security-

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Pat from comment #0)
> The fallback behavior of posix_fallocate() is a disaster. The entire point
> of this function is to improve system performance by allowing applications
> to preallocate large extents, helping the O/S to minimize on-disk
> fragmentation.
> 
> But the behavior of this call on file systems lacking unwritten extents
> ultimately results in two writes to every "preallocated" block: Once to
> "preallocate", and once to populate with actual data. This is the exact
> opposite of a performance improvement.

Callers who want to avoid double-writes can use fallocate instead.  This is
explained in the glibc manual.

We analyzed this issue recently, and we decided that we have to preserve the
fallback (note that I completely changed my opinion after reviewing how
application code uses posix_fallocate right now):

https://sourceware.org/ml/libc-alpha/2015-04/msg00309.html
https://sourceware.org/ml/libc-alpha/2015-05/msg00058.html

So we really can't fix this bug, even though fallback is problematic.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]