mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: test xfs_copy V5 XFS without -d option
Before xfsprogs commit a872b62 (xfs_copy: band-aids for CRC
filesystems), xfs_copy requires the "-d" option to copy a V5 XFS,
because it can't rewrite the UUID of V5 XFS properly.
Now xfs_copy already full support to copy a V5 XFS. But for above
old problem, xfstests use below patch to make sure xfs_copy always
use "-d" option to copy a V5 XFS:
8346e53 common: append -d option to XFS_COPY_PROG when testing v5 xfs
That cause xfstests miss the coverage of copying a V5 XFS without
"-d". For test this feature I did below things:
1. Changed init_rc(), add "-d" to $XFS_COPY_PROG if xfs_copy can't
copy a V5 XFS properly.
2. xfs/073 test V4 xfs forcibly by specify "-m crc=0" in case. I
think it's useless now, so remove it.
3. Changed xfs/032. If xfs_copy full support to copy a V5 XFS, test
with and without "-d" option, or only test with "-d" option.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+16
-5
@@ -53,6 +53,17 @@ IMGFILE=$TEST_DIR/${seq}_copy.img
|
||||
|
||||
echo "Silence is golden."
|
||||
|
||||
do_copy()
|
||||
{
|
||||
local opts="$*"
|
||||
|
||||
$XFS_COPY_PROG $opts $SCRATCH_DEV $IMGFILE >> $seqres.full 2>&1 || \
|
||||
_fail "xfs_copy $opts failed for Sector size $SECTORSIZE Block size $BLOCKSIZE"
|
||||
# Must use "-n" to get exit code; without it xfs_repair always returns 0
|
||||
$XFS_REPAIR_PROG -n -f $IMGFILE >> $seqres.full 2>&1 || \
|
||||
_fail "xfs_copy $opts corrupted for Sector size $SECTORSIZE Block size $BLOCKSIZE"
|
||||
}
|
||||
|
||||
while [ $SECTORSIZE -le $PAGESIZE ]; do
|
||||
BLOCKSIZE=$SECTORSIZE;
|
||||
|
||||
@@ -70,11 +81,11 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do
|
||||
$FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1
|
||||
_scratch_unmount
|
||||
|
||||
$XFS_COPY_PROG -d $SCRATCH_DEV $IMGFILE >> $seqres.full 2>&1 || \
|
||||
_fail "Copy failed for Sector size $SECTORSIZE Block size $BLOCKSIZE"
|
||||
# Must use "-n" to get exit code; without it xfs_repair always returns 0
|
||||
$XFS_REPAIR_PROG -n -f $IMGFILE >> $seqres.full 2>&1 || \
|
||||
_fail "Copy corrupted for Sector size $SECTORSIZE Block size $BLOCKSIZE"
|
||||
# Test "duplicate" copy at first, if $XFS_COPY_PROG won't do it.
|
||||
if [[ ! "$XFS_COPY_PROG" =~ -d ]]; then
|
||||
do_copy -d
|
||||
fi
|
||||
do_copy
|
||||
|
||||
BLOCKSIZE=$(($BLOCKSIZE * 2));
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user