]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/{243,245,272,274}: ignore raid alignment flags in bmap output
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 May 2023 20:08:28 +0000 (13:08 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 14 May 2023 13:51:27 +0000 (21:51 +0800)
This test doesn't care about the RAID alignment status of the mappings
that it finds; it only cares about shared and unwritten.  Ignore the
mapping stripe alignment flags in the bmapx output.  This fixes this
test when the fs has su=128k,sw=4.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/243
tests/xfs/245
tests/xfs/272
tests/xfs/274

index 514fa35667fd6ed23d63b90854d0b8d09a4665bf..2e537f3f5578f2932e5b3e90e95e5d8ead36e7ac 100755 (executable)
@@ -92,16 +92,16 @@ echo "Delayed allocation CoW extents:"
 test $(_xfs_bmapx_find cow $testdir/file3 delalloc) -gt 0 || \
        echo "Expected to find a delalloc CoW extent"
 echo "Shared data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '10[01]{4}$') -gt 0 || \
        echo "Expected to find a shared data extent"
 echo "Unwritten data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '1[01]{4}$') -gt 0 || \
        echo "Expected to find an unwritten data extent"
 echo "Hole data extents:"
 test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \
        echo "Expected to find a hole data extent"
 echo "Regular data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \
        echo "Expected to find a regular data extent"
 
 sync
@@ -115,16 +115,16 @@ echo "Real CoW extents:"
 test $(_xfs_bmapx_find cow $testdir/file3 delalloc ) -eq 0 || \
        echo "Expected to find zero delalloc CoW extent"
 echo "Shared data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '10[01]{4}$') -gt 0 || \
        echo "Expected to find a shared data extent"
 echo "Unwritten data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '1[01]{4}$') -gt 0 || \
        echo "Expected to find an unwritten data extent"
 echo "Hole data extents:"
 test $(_xfs_bmapx_find data $testdir/file3 hole) -gt 0 || \
        echo "Expected to find a hole data extent"
 echo "Regular data extents:"
-test $(_xfs_bmapx_find data $testdir/file3 '000000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \
        echo "Expected to find a regular data extent"
 
 _scratch_cycle_mount
index 0cd0935cfa7ca73eee058387aaff323fa44b80b4..595a5938b42aaffad2a478e0d4e49fd658781000 100755 (executable)
@@ -42,17 +42,17 @@ md5sum $testdir/file1 | _filter_scratch
 md5sum $testdir/file2 | _filter_scratch
 
 echo "Unwritten data extents"
-test $(_xfs_bmapx_find data $testdir/file1 '10000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file1 -E '1[01]{4}$') -gt 0 || \
        echo "Expected to find an unwritten file1 extent"
 echo "Shared data extents"
-test $(_xfs_bmapx_find data $testdir/file1 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file1 -E '10[01]{4}$') -gt 0 || \
        echo "Expected to find a shared data extent"
 
 echo "Hole data extents"
 test $(_xfs_bmapx_find data $testdir/file2 'hole') -gt 0 || \
        echo "Expected to find a hole data extent"
 echo "Shared data extents"
-test $(_xfs_bmapx_find data $testdir/file2 '100000$') -gt 0 || \
+test $(_xfs_bmapx_find data $testdir/file2 -E '10[01]{4}$') -gt 0 || \
        echo "Expected to find a shared data extent"
 
 echo "Hole cow extents"
index 7ed8b95122221b22e913fe84b7010ea1df880bdd..c68fa9d6140e8b51a9bfd70b018b91dd45821033 100755 (executable)
@@ -49,10 +49,10 @@ $XFS_IO_PROG -c 'bmap -v' $SCRATCH_MNT/urk | grep '^[[:space:]]*[0-9]*:' | grep
 
 echo "Check bmap and fsmap" | tee -a $seqres.full
 cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
-       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total}$"
+       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total}(| [01]*)$"
        echo "${qstr}" >> $seqres.full
        grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
-       found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+       found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
        test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
 done
 
index dcaea6880469c8ae2fce3bfbdaa79dd36b0af2fb..cd483d77bc2469e02f9ec424d9cc4f0de4639c19 100755 (executable)
@@ -49,10 +49,10 @@ $XFS_IO_PROG -c 'bmap -v' $SCRATCH_MNT/f1 | grep '^[[:space:]]*[0-9]*:' | grep -
 
 echo "Check f1 bmap and fsmap" | tee -a $seqres.full
 cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
-       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 0100000$"
+       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 010[01]{4}$"
        echo "${qstr}" >> $seqres.full
        grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
-       found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+       found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
        test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
 done
 
@@ -62,10 +62,10 @@ $XFS_IO_PROG -c 'bmap -v' $SCRATCH_MNT/f2 | grep '^[[:space:]]*[0-9]*:' | grep -
 
 echo "Check f2 bmap and fsmap" | tee -a $seqres.full
 cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total crap; do
-       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 0100000$"
+       qstr="^[[:space:]]*[0-9]*:[[:space:]]*[0-9]*:[0-9]*[[:space:]]*${blockrange} :[[:space:]]*${ino}[[:space:]]*${offrange}[[:space:]]*${ag}[[:space:]]*${agrange}[[:space:]]*${total} 010[01]{4}$"
        echo "${qstr}" >> $seqres.full
        grep "${qstr}" $TEST_DIR/fsmap >> $seqres.full
-       found=$(grep -c "${qstr}" $TEST_DIR/fsmap)
+       found=$(grep -E -c "${qstr}" $TEST_DIR/fsmap)
        test $found -eq 1 || echo "Unexpected output for offset ${offrange}."
 done