The test harness already takes care of this, so get rid of it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
_reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full"
_reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full"
-echo "Check scratch fs"
-_scratch_unmount
-
# success, all done
status=0
exit
Try to reflink an append-only file
XFS_IOC_CLONE_RANGE: Bad file descriptor
Reflink two files
-Check scratch fs
_dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full"
_dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full"
-echo "Check scratch fs"
-_scratch_unmount
-
# success, all done
status=0
exit
dedupe: Invalid argument
Try to dedupe an append-only file
Dedupe two files
-Check scratch fs
_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
wait
-echo "Check fs"
-umount "$SCRATCH_MNT"
-
-echo "Done"
# success, all done
status=0
exit
Format and mount
Initialize files
Delete while rewriting
-Check fs
-Done
touch "$testdir/finished"
wait
-echo "Check fs"
-umount "$SCRATCH_MNT"
-
-echo "Done"
# success, all done
status=0
exit
Initialize files
Dedupe and rewrite the file!
Finished dedupeing
-Check fs
-Done
touch "$testdir/finished"
wait
-echo "Check fs"
-umount "$SCRATCH_MNT"
-
-echo "Done"
# success, all done
status=0
exit
Initialize files
Dedupe and rewrite the file!
Finished dedupeing
-Check fs
-Done
touch "$testdir/finished"
wait
-echo "Check fs"
-umount "$SCRATCH_MNT"
-
-echo "Done"
# success, all done
status=0
exit
Initialize files
Reflink and reread the files!
Finished reflinking
-Check fs
-Done
touch "$testdir/finished"
wait
-echo "Check fs"
-umount "$SCRATCH_MNT"
-
-echo "Done"
# success, all done
status=0
exit
Initialize files
Reflink and dio reread the files!
Finished reflinking
-Check fs
-Done
touch $testdir/finished
wait
-echo "Check for damage"
-_scratch_unmount
-
-echo "Done"
-
# success, all done
status=0
exit
Format and mount
Initialize file
Snapshot a file undergoing directio rewrite
-Check for damage
-Done
touch $testdir/finished
wait
-echo "Check for damage"
-_scratch_unmount
-
-echo "Done"
-
# success, all done
status=0
exit
Format and mount
Initialize file
Snapshot a file undergoing buffered rewrite
-Check for damage
-Done
touch "$testdir/finished"
wait
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
-echo "Done"
-
# success, all done
status=0
exit
Format and mount
Initialize files
Reflink and write the target
-Check for damage
-Done
touch "$testdir/finished"
wait
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
-echo "Done"
-
# success, all done
status=0
exit
Format and mount
Initialize files
Reflink and dio write the target
-Check for damage
-Done
echo "${out}" >> "$seqres.full" 2>&1
echo "${out}"
-#filefrag -v $testdir/bigfile
-#filefrag -v $testdir/clonefile
-
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
pwrite64: No space left on device
Remount and try CoW again
pwrite64: No space left on device
-Check scratch fs
echo "${out}" >> "$seqres.full" 2>&1
echo "${out}"
-#filefrag -v $testdir/bigfile
-#filefrag -v $testdir/clonefile
-
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
pwrite64: No space left on device
Remount and try CoW again
pwrite64: No space left on device
-Check scratch fs
echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)"
fi
-#filefrag -v $testdir/bigfile
-#filefrag -v $testdir/clonefile
-
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Allocate the rest of the space
mmap CoW the big file
Remount and try CoW again
-Check scratch fs
echo "${out}" >> "$seqres.full" 2>&1
echo "${out}"
-#filefrag -v $testdir/bigfile
-#filefrag -v $testdir/clonefile
-
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
pwrite64: No space left on device
Remount and try CoW again
pwrite64: No space left on device
-Check scratch fs
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-183/file2
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-183/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-183/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
b83f9394092e15bdcda585cd8e776dc6 SCRATCH_MNT/test-185/file2
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-185/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-185/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-186/file2
1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-186/file3
1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-186/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
35219c511215d00a857243965ea5ed9c SCRATCH_MNT/test-187/file2
1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-187/file3
1801718b8daeb8d3ad4900bd9137b3e8 SCRATCH_MNT/test-187/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-188/file1
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-188/file3
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-188/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-189/file1
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-189/file3
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-189/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-190/file1
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-190/file3
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-190/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-191/file1
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-191/file3
09101629908f9bdd5d178e7ce20bb1bb SCRATCH_MNT/test-191/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-194/file1
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-194/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-194/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-195/file1
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-195/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-195/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-196/file1
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-196/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-196/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-197/file1
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-197/file3
55968a95dfc0120df4e8485576514320 SCRATCH_MNT/test-197/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-199/file1
36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3
36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-199/file3.chk
-Check for damage
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
bdbcf02ee0aa977795a79d25fcfdccb1 SCRATCH_MNT/test-200/file1
36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3
36f6b5317a9a921fc91175390ccf7f69 SCRATCH_MNT/test-200/file3.chk
-Check for damage
"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
rm "$testdir/file3"
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-201/file3
d3959a68638c50af07f0258e032cb554 SCRATCH_MNT/test-201/file3.chk
CoW and unmount
-Check for damage
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file2.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-202/file1
7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-202/file2
7cd112044b63b2c979f45e7c1e7cc85f SCRATCH_MNT/test-202/file2.chk
-Check for damage
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file2.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
75f550706b7d54e6ae59a8220b532285 SCRATCH_MNT/test-203/file1
227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-203/file2
227f44bb2dcf251ebf0217edaeb1e365 SCRATCH_MNT/test-203/file2.chk
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
runtest delalloc hole "$testdir/d-h"
runtest delalloc regular "$testdir/d-r"
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
runtest delalloc hole "$testdir/d-h"
runtest delalloc regular "$testdir/d-r"
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW and unmount
Compare files
-Check for damage
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file2.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-242/file1
c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-242/file2
c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-242/file2.chk
-Check for damage
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file2.chk" | _filter_scratch
-echo "Check for damage"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
01768a16d33c9bd21dc67a7fac006ee1 SCRATCH_MNT/test-243/file1
c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-243/file2
c835fd53fa27b72511b250d51595c053 SCRATCH_MNT/test-243/file2.chk
-Check for damage
xfs_info "$SCRATCH_MNT" >> "$seqres.full"
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Create the original file and reflink to copy1, copy2
Grow fs
Create more reflink copies
-Check scratch fs
_within_tolerance "free blocks after defragging all reflink copies" $free_blocks3 $((free_blocks2 - (blks * 2 * blksz_factor))) $margin -v
_within_tolerance "free blocks after all tests" $free_blocks3 $((free_blocks0 - (blks * 3 * blksz_factor))) $margin -v
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
free blocks after CoW some reflink copies is in range
free blocks after defragging all reflink copies is in range
free blocks after all tests is in range
-Check scratch fs
test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file."
-echo "Check restored fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Create the original file blocks
Reflink every block
cp: failed to clone 'SCRATCH_MNT/test-131/file2' from 'SCRATCH_MNT/test-131/file1': Invalid argument
-Check restored fs
md5sum "$testdir/file2" | _filter_scratch
#filefrag -v "$testdir/file1" "$testdir/file2"
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
673c759fb131ccf3336c4f8c549a497e SCRATCH_MNT/test-139/file1
dc802351f6717547cbf4c951b294f952 SCRATCH_MNT/test-139/file2
-Check scratch fs
! cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 must not match"
cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
-echo "Check scratch fs"
-umount "$SCRATCH_MNT"
-
# success, all done
status=0
exit
Compare files
CoW every other block
Compare files
-Check scratch fs