Bug 617690 - ext4 and xfs wrong data returned on read after write if file size was changed with ftruncate
Summary: ext4 and xfs wrong data returned on read after write if file size was changed...
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 5.7
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: Boris Ranto
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-23 18:36 UTC by Chris Brown
Modified: 2018-12-01 18:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-01-13 21:44:45 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0017 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.6 kernel security and bug fix update 2011-01-13 10:37:42 UTC
Linux Kernel 16165 None None None 2019-02-26 15:53 UTC

Description Chris Brown 2010-07-23 18:36:22 UTC
from: https://bugzilla.kernel.org/show_bug.cgi?id=16165 [^]

> we use the direct async I/O API for file I/O in VirtualBox since 3.2 and got
> some reports about corrupted guest filesystems. It turned out that only users
> are affected which disk images are stored on a ext4 filesystem. I could create
> a testcase which reproduces the error. Further investigation showed that the
> data corruption happens if ftruncate is used, data is written to the so far
> unallocated offset and immediately read back. The buffer holding the read data
> contains only \0 afterwards. The data is there if the file is closed and
> another program is used to view the file content (less for example). 
> Everything works if ftruncate is not used.

The test case is in the original bug report, which includes patches
for ext4 and xfs.

Reproducible: Always  
Additional Information  This bug is preventing the usage of ext4 and xfs based filesystems with any
software which uses aio and ftruncate. VirtualBox is is rendered unuseable with
ext4 and XFS filesystems as a result of this bug.

Comment 1 Eric Sandeen 2010-07-26 20:19:13 UTC
The patches were claimed to fix the problem, but we've seen other issues w/ unaligned AIO to a sparse image file (think imagefile on ext4, with a partition starting on sector 63) which haven't been fixed yet.

We can leave this bug on for the originally reported (& fixed) problem, but wanted folks to be aware of the other unaligned/sparse/aio issue.

Comment 2 Chris Brown 2010-07-27 04:01:52 UTC
The patches do resolve the issue however applying them results in a non standard RHEL/CentOS/OEL kernel. Will this issue be addressed with the existing RHEL 5.5? I assume if this is not the case that at least this specific case as well as the others will be addressed with RHEL 6?

Comment 3 Eric Sandeen 2010-07-27 16:27:32 UTC
This is something we can try to address for RHEL5.6.

This specific case (as reported in the kernel.org bugzilla) is fixed in RHEL6.


Comment 4 RHEL Product and Program Management 2010-07-27 16:39:16 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update

Comment 5 Eric Sandeen 2010-07-27 16:40:09 UTC
Also - I assume that a workaround might be to pre-allocate the image, in the meantime?

Comment 10 Jarod Wilson 2010-09-10 21:40:56 UTC
in kernel-2.6.18-219.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 14 errata-xmlrpc 2011-01-13 21:44:45 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.