From: David Disseldorp Date: Thu, 17 May 2007 15:58:12 +0000 (+0000) Subject: Currently there are a few ways mkfs options are specified in XFSQA: X-Git-Tag: v1.1.0~497 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=498eb16b5564f47a06b1b8569927d672fb801274;p=xfstests-dev.git Currently there are a few ways mkfs options are specified in XFSQA: 1) suite wide MKFS_OPTIONS are specified before tests are run e.g. vimes:/home/fsgqa/kali/xfsqa/xfstests # export MKFS_OPTIONS="-l size=100m" 2) test wide MKFS_OPTIONS are specified during a particular test e.g. 119 export MKFS_OPTIONS="-l version=2,size=1200b,su=64k" 3) mkfs options are appended by a test at mkfs time e.g. 083 _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seq.full (4) Another form of appending is just appending to MKFS_OPTIONS directly e.g. 114:export MKFS_OPTIONS="$MKFS_OPTIONS -i parent=1" 115:export MKFS_OPTIONS="$MKFS_OPTIONS -i paths=1" Conflicts between mkfs options specified with method 1 & 3 are common. 960377 XFSQA 041, 042 - mkfs fails with large log size MKFS_OPTIONS. This change means if a mkfs fails where mkfs options have been appended by a test (method 3), The mkfs is retried using only those options defined by the test. occurances of method 4 (in test 114 & 115) are also changed to use method 3. $seq.full logs the fact that a mkfs options conflict has occured. Merge of master-melb:xfs-cmds:28601a by kenmcd. append -i parent mkfs option using _scratch_mkfs_xfs -i parent... rather than export MKFS_OPTIONS="$MKFS_OPTIONS -i parent=1. this avoids mkfs option conflicts --- diff --git a/114 b/114 index 5048a273..5f7c23db 100755 --- a/114 +++ b/114 @@ -306,8 +306,7 @@ rm -f $here/$seq.full echo "mkfs" _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \ || _fail "mkfs scratch failed" -export MKFS_OPTIONS="$MKFS_OPTIONS -i parent=1" -_scratch_mkfs_xfs >>$here/$seq.full 2>&1 \ +_scratch_mkfs_xfs -i parent=1 >>$here/$seq.full 2>&1 \ || _notrun "parent inodes not supported" echo "mount" diff --git a/115 b/115 index eca88084..8292de8b 100755 --- a/115 +++ b/115 @@ -92,8 +92,7 @@ rm -f $here/$seq.full echo "mkfs" _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \ || _fail "mkfs scratch failed" -export MKFS_OPTIONS="$MKFS_OPTIONS -i paths=1" -_scratch_mkfs_xfs >>$here/$seq.full 2>&1 \ +_scratch_mkfs_xfs -i paths=1 >>$here/$seq.full 2>&1 \ || _notrun "i_paths not supported" echo "mount" diff --git a/common.rc b/common.rc index 8657ed14..019476f2 100644 --- a/common.rc +++ b/common.rc @@ -194,10 +194,25 @@ _scratch_mkfs_options() _scratch_mkfs_xfs() { + # extra mkfs options can be added by tests + local extra_mkfs_options=$* + _scratch_options mkfs - $MKFS_XFS_PROG $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV - mkfs_status=$? + $MKFS_XFS_PROG $SCRATCH_OPTIONS $MKFS_OPTIONS $extra_mkfs_options $SCRATCH_DEV + local mkfs_status=$? + + # a mkfs failure may be caused by conflicts between + # $MKFS_OPTIONS and $extra_mkfs_options + + if [ $mkfs_status -ne 0 -a ! -z "$extra_mkfs_options" ]; then + echo "** mkfs failed with extra mkfs options added to \"$MKFS_OPTIONS\" by test $seq **" \ + >>$here/$seq.full + echo "** attempting to mkfs using only test $seq options: $extra_mkfs_options **" \ + >>$here/$seq.full + $MKFS_XFS_PROG $SCRATCH_OPTIONS $extra_mkfs_options $SCRATCH_DEV + mkfs_status=$? + fi if [ "$USE_BIG_LOOPFS" = yes ]; then [ -z "$RETAIN_AG_BYTES" ] && RETAIN_AG_BYTES=0