On 2022-07-19 02:14, Christoph Hellwig wrote:
The commited old version test the broken behavior of the current
upstream code that writes the uncompressed data into a previously
bad mirror. Fix the test to check that the compressed data gets
re-replicated and add it to the compress group while we're at it.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@xxxxxxxxxx>
---
tests/btrfs/270 | 11 +++++++----
tests/btrfs/270.out | 34 ----------------------------------
2 files changed, 7 insertions(+), 38 deletions(-)
diff --git a/tests/btrfs/270 b/tests/btrfs/270
index 4229a02c..5b73fb15 100755
--- a/tests/btrfs/270
+++ b/tests/btrfs/270
@@ -7,7 +7,7 @@
# Regression test for btrfs buffered read repair of compressed data.
#
. ./common/preamble
-_begin_fstest auto quick read_repair
+_begin_fstest auto quick read_repair compress
. ./common/filter
@@ -60,7 +60,9 @@ _scratch_unmount
echo "step 2......corrupt file extent"
echo " corrupt stripe #1, devid $devid devpath $devpath physical
$physical" \
>> $seqres.full
-$XFS_IO_PROG -d -c "pwrite -S 0xbb -b 64K $physical 64K" $devpath >
/dev/null
+dd if=$devpath of=$TEST_DIR/$seq.dump.good skip=$physical bs=1
count=4096 \
+ 2>/dev/null
+$XFS_IO_PROG -c "pwrite -S 0xbb -b 4K $physical 4K" $devpath >
/dev/null
_scratch_mount
@@ -70,8 +72,9 @@ _btrfs_buffered_read_on_mirror 1 2
"$SCRATCH_MNT/foobar" 0 128K
_scratch_unmount
echo "step 4......check if the repair worked"
-$XFS_IO_PROG -c "pread -v -b 512 $physical 512" $devpath |\
- _filter_xfs_io_offset
+dd if=$devpath of=$TEST_DIR/$seq.dump skip=$physical bs=1 count=4096 \
+ 2>/dev/null
+cmp -bl $TEST_DIR/$seq.dump.good $TEST_DIR/$seq.dump
_scratch_dev_pool_put
# success, all done
diff --git a/tests/btrfs/270.out b/tests/btrfs/270.out
index 53a80692..6d744c02 100644
--- a/tests/btrfs/270.out
+++ b/tests/btrfs/270.out
@@ -5,37 +5,3 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX
ops/sec)
step 2......corrupt file extent
step 3......repair the bad copy
step 4......check if the repair worked
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
................
-read 512/512 bytes
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)