summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-04-20 10:15:15 +0200
committerJim Meyering <meyering@redhat.com>2011-04-20 18:48:38 +0200
commitbef4fa1e1a20c636979db159647a93e5954bc542 (patch)
treee2a61c2d1044124747b71f80a5ad628c24c5e3f2 /src
parent9bcd045f812a75cf96ba392bc45529422f87c088 (diff)
downloadcoreutils-bef4fa1e1a20c636979db159647a93e5954bc542.tar.xz
copy: do not treat unwritten extents specially: avoid XFS/ext4 data loss
* src/copy.c (extent_copy): Do not treat "unwritten extents" specially. Otherwise, with a release-candidate 2.6.39-rc3 kernel, XFS or ext4, when using gold as your linker, and if you forget to run "make check", you could end up installing files full of zeros instead of the expected binaries. For a lot of discussion, see http://thread.gmane.org/gmane.comp.file-systems.xfs.general/37895 * tests/cp/fiemap-empty: Disable this test.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index 9b53127c4..f6f9ea6f2 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -398,7 +398,10 @@ extent_copy (int src_fd, int dest_fd, char *buf, size_t buf_size,
/* Treat an unwritten but allocated extent much like a hole.
I.E. don't read, but don't convert to a hole in the destination,
unless SPARSE_ALWAYS. */
- if (scan.ext_info[i].ext_flags & FIEMAP_EXTENT_UNWRITTEN)
+ /* For now, do not treat FIEMAP_EXTENT_UNWRITTEN specially,
+ because that (in combination with no sync) would lead to data
+ loss at least on XFS and ext4 when using 2.6.39-rc3 kernels. */
+ if (0 && (scan.ext_info[i].ext_flags & FIEMAP_EXTENT_UNWRITTEN))
{
empty_extent = true;
last_ext_len = 0;