]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: fix copying of extents beyond the apparent file size
authorDmitry Monakhov <dmonakhov@openvz.org>
Fri, 30 Oct 2015 22:04:46 +0000 (22:04 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 24 Nov 2015 00:49:03 +0000 (00:49 +0000)
commiteea6b49210edf69682b2d0606bee17bbccb3765b
tree84e120fb2c31c0345b729a8ffe731e477ff4db78
parent6df26278d6cf5c6fad04d3fbaed4c06a223fb0bd
copy: fix copying of extents beyond the apparent file size

fallocate can allocate extents beyond EOF via FALLOC_FL_KEEP_SIZE.
Where there is a gap (hole) between the extents, and EOF is within
that gap, the final hole wasn't reproduced, resulting in silent
data corruption in the copied file (size too small).

* src/copy.c (extent_copy): Ensure we don't process extents
beyond the apparent file size, since processing and allocating
those is not currently supported.
* tests/cp/fiemap-extents.sh: Renamed from tests/cp/fiemap-empty.sh
and re-enable parts checking the extents at and beyond EOF.
* tests/local.mk: Reference the renamed test.
* NEWS: Mention the bug fix.
Fixes http://bugs.gnu.org/21790
NEWS
src/copy.c
tests/cp/fiemap-empty.sh [deleted file]
tests/cp/fiemap-extents.sh [new file with mode: 0755]
tests/local.mk