coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coreutils] cp/reflink-perm fails on btrfs (and probably on ocfs2, too)


From: Jim Meyering
Subject: [coreutils] cp/reflink-perm fails on btrfs (and probably on ocfs2, too)
Date: Tue, 26 Oct 2010 11:39:58 +0200

The cp/reflink-perm test fails on a btrfs file system:

    echo > file2 # file with data
    cp --reflink=auto --preserve --attributes-only file2 empty_copy || fail=1
    test -s empty_copy && fail=1

because with --reflink=auto, the file contents are copied, too,
and "empty_copy" does have nonzero size.

Here's the patch I'll probably use to solve that:

>From 4df6a5f89cb5abd3f48ba3fa1653a0b732165a76 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 26 Oct 2010 11:36:08 +0200
Subject: [PATCH] tests: avoid false-positive failure on btrfs

* tests/cp/reflink-perm: Don't fail the final sub-test on reflink-
capable file systems.  The final sub-test assumed that cp with
--reflink=auto would not perform a reflink copy and that "empty_copy"
would be empty.  Obviously, on btrfs that is not true.
---
 tests/cp/reflink-perm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm
index 77f119f..bd8f2ac 100755
--- a/tests/cp/reflink-perm
+++ b/tests/cp/reflink-perm
@@ -41,6 +41,9 @@ test copy -nt file && fail=1

 echo > file2 # file with data
 cp --reflink=auto --preserve --attributes-only file2 empty_copy || fail=1
-test -s empty_copy && fail=1
+
+# The above copies data too, on a reflink-capable file system,
+# so skip the following test on such a file system.
+cp --reflink=always copy c2 || { test -s empty_copy && fail=1; }

 Exit $fail
--
1.7.3.1.216.g329be



reply via email to

[Prev in Thread] Current Thread [Next in Thread]