summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2015-02-23 22:37:08 +1100
committerLuis Henriques <luis.henriques@canonical.com>2015-05-20 13:26:25 +0100
commitc6ea4217976fa94b55811a02472ba667c2f6ab2e (patch)
tree4a0f2ec146a7f95a517af74ec2d10630c025c774 /include
parent7021076a4bc6ac6c26e7c22193473314d9c70b11 (diff)
xfs: ensure truncate forces zeroed blocks to disk
commit 5885ebda878b47c4b4602d4b0410cb4b282af024 upstream. A new fsync vs power fail test in xfstests indicated that XFS can have unreliable data consistency when doing extending truncates that require block zeroing. The blocks beyond EOF get zeroed in memory, but we never force those changes to disk before we run the transaction that extends the file size and exposes those blocks to userspace. This can result in the blocks not being correctly zeroed after a crash. Because in-memory behaviour is correct, tools like fsx don't pick up any coherency problems - it's not until the filesystem is shutdown or the system crashes after writing the truncate transaction to the journal but before the zeroed data in the page cache is flushed that the issue is exposed. Fix this by also flushing the dirty data in memory region between the old size and new size when we've found blocks that need zeroing in the truncate process. Reported-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com> [ luis: backported to 3.16: adjusted context ] Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions