mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fix filter for stripe aligned filesystems
Flags has extra bits set in it xfs_bmap output when the filesyste is using stripe alignment. Fix the test to only look at the unwritten flag. Capture the xfs_bmap output as well so failures can be debugged easily. Merge of master-melb:xfs-cmds:30994a by kenmcd. fix filter for stripe aligned filesystems.
This commit is contained in:
@@ -17,6 +17,7 @@ here=`pwd`
|
|||||||
tmp=/tmp/$$
|
tmp=/tmp/$$
|
||||||
status=1 # failure is the default!
|
status=1 # failure is the default!
|
||||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
rm -f $seq.full
|
||||||
|
|
||||||
_cleanup()
|
_cleanup()
|
||||||
{
|
{
|
||||||
@@ -39,9 +40,14 @@ _filter_blocks()
|
|||||||
unwritten2 = ((1048576/512) / 2) - 2 * written_size
|
unwritten2 = ((1048576/512) / 2) - 2 * written_size
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($7) {
|
/* is the extent unwritten? */
|
||||||
size = "RIGHT"
|
unwritten_ext = 0;
|
||||||
flags = "GOOD"
|
if ($7 >= 10000)
|
||||||
|
unwritten_ext = 1;
|
||||||
|
|
||||||
|
size = "RIGHT"
|
||||||
|
flags = "GOOD"
|
||||||
|
if (unwritten_ext) {
|
||||||
if (unwritten1) {
|
if (unwritten1) {
|
||||||
if ($6 != unwritten1)
|
if ($6 != unwritten1)
|
||||||
size = "WRONG"
|
size = "WRONG"
|
||||||
@@ -49,11 +55,7 @@ _filter_blocks()
|
|||||||
} else if ($6 != unwritten2) {
|
} else if ($6 != unwritten2) {
|
||||||
size = "WRONG"
|
size = "WRONG"
|
||||||
}
|
}
|
||||||
if ($7 < 10000)
|
|
||||||
flags = "BAD"
|
|
||||||
} else {
|
} else {
|
||||||
size = "RIGHT"
|
|
||||||
flags = "GOOD"
|
|
||||||
if ($6 != written_size)
|
if ($6 != written_size)
|
||||||
size = "WRONG"
|
size = "WRONG"
|
||||||
}
|
}
|
||||||
@@ -77,6 +79,7 @@ FILE_SIZE=1048576
|
|||||||
rm -f $TEST_FILE
|
rm -f $TEST_FILE
|
||||||
$TEST_PROG $FILE_SIZE $TEST_FILE
|
$TEST_PROG $FILE_SIZE $TEST_FILE
|
||||||
|
|
||||||
|
xfs_bmap -vp $TEST_FILE >> $seq.full
|
||||||
xfs_bmap -vp $TEST_FILE | _filter_blocks
|
xfs_bmap -vp $TEST_FILE | _filter_blocks
|
||||||
|
|
||||||
status=0
|
status=0
|
||||||
|
|||||||
Reference in New Issue
Block a user