[PATCH 1/2] generic/517: expect truthful dedupe progress
Matthias Goergens <[email protected]>
| Newsgroups | org.kernel.vger.fstests |
|---|---|
| Message-ID | <[email protected]> |
The VFS currently reports the requested FIDEDUPERANGE length even when it
shortens the operation to avoid sharing a partial EOF block into the middle
of the destination. Once the kernel reports its actual progress, the first
dedupe in this test reports 131072 of 131172 bytes. xfs_io then retries the
100-byte remainder, which cannot make progress and returns -EINVAL. The
separate 100-byte request returns the same error.
Update the golden output for those truthful results. This is the output
change that caused commit 4a57a8400075 ("vf/remap: return the amount of
bytes actually deduplicated") to be reverted. The paired kernel series that
determines the new output is linked from the cover letter.
The updated test passes on btrfs and XFS with the paired kernel changes.
Signed-off-by: Matthias Goergens <[email protected]>
---
tests/generic/517 | 6 ++++++
tests/generic/517.out | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/generic/517 b/tests/generic/517
index 3f7027a8..ab5d17e7 100755
--- a/tests/generic/517
+++ b/tests/generic/517
@@ -11,6 +11,12 @@
. ./common/preamble
_begin_fstest auto quick dedupe clone
+# The dedupe amounts this test records are only correct once the kernel
+# reports the number of bytes it actually deduplicated rather than the number
+# requested. Both dedupe calls below target a range that does not reach the
+# destination's EOF, so generic_remap_check_len() shortens them under
+# REMAP_FILE_CAN_SHORTEN.
+
# Import common functions.
. ./common/filter
. ./common/reflink
diff --git a/tests/generic/517.out b/tests/generic/517.out
index b9b63207..6ba753d8 100644
--- a/tests/generic/517.out
+++ b/tests/generic/517.out
@@ -13,7 +13,8 @@ File content before first deduplication:
*
0786528 ae ae ae ae
0786532
-deduped 131172/131172 bytes at offset 65536
+XFS_IOC_FILE_EXTENT_SAME: Invalid argument
+deduped 131072/131172 bytes at offset 65536
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
File content after first deduplication and before unmounting:
0000000 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
@@ -33,8 +34,7 @@ File content after first unmount:
0786532
wrote 100/100 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-deduped 100/100 bytes at offset 655360
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+XFS_IOC_FILE_EXTENT_SAME: Invalid argument
File content after second deduplication:
0000000 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
*
--
2.55.0