xfs/098: adapt to external log devices
[xfstests-dev.git] / tests / xfs / 098
index c63b9d60f79c7f04b4a83c734b65d6fb9e3b9a9c..b7d3253e02db5c8213c61bcf7af47e706fca2a9e 100755 (executable)
@@ -76,7 +76,13 @@ echo "+ corrupt image"
 logstart="$(_scratch_xfs_get_sb_field logstart)"
 logstart="$(_scratch_xfs_db -c "convert fsblock ${logstart} byte" | sed -e 's/^.*(\([0-9]*\).*$/\1/g')"
 logblocks="$(_scratch_xfs_get_sb_field logblocks)"
-$XFS_IO_PROG -f -c "pwrite -S 0x62 ${logstart} $((logblocks * blksz))" "${SCRATCH_DEV}" >> $seqres.full
+
+if [ "$USE_EXTERNAL" = yes ] && [ ! -z "$SCRATCH_LOGDEV" ]; then
+       logdev=$SCRATCH_LOGDEV
+else
+       logdev=$SCRATCH_DEV
+fi
+$XFS_IO_PROG -f -c "pwrite -S 0x62 ${logstart} $((logblocks * blksz))" $logdev >> $seqres.full
 
 echo "+ mount image"
 _try_scratch_mount 2>/dev/null && _fail "mount should not succeed"