From 032f2250086fec2ebda3832f260c3a8955cf281f Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Tue, 29 Sep 2015 11:32:36 -0400 Subject: Files open O_WRONLY not supported in fallocate emulation. In the posix_fallocate description in the manual we list various drawbacks with the emulation, including the fact that a file opened with O_APPEND fails with EBADF. Similarly a file opened with O_WRONLY fails with EBADF. We must be able to emulate a compare-and-swap via pread/compare/pwrite in order to make the emulation as safe as possible. It is not acceptable to ignore the read failure because it could result in significant data loss across all of the blocks. There is no other way to make this work without a true atomic CAS and SIGBUS handler (which is looking more attractive as a way to remove the race condition). This patch adds O_WRONLY to the manual as another bullet to clarify the limits of the emulation. Manual looks good in PDF. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 8b5050be4d..8851c6be85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-29 Carlos O'Donell + + * manual/filesys.texi (Storage Allocation): Document that + posix_fallocate emulation fails when fd is open with O_WRONLY. + 2015-09-28 Joseph Myers [BZ #19016] -- cgit 1.4.1