From 2e20a22ecb8d260e42290eac956dc941d5d80114 Mon Sep 17 00:00:00 2001 From: huanghua Date: Wed, 11 Feb 2009 02:33:23 +0000 Subject: [PATCH] Branch HEAD b=17158 i=grev i=rahul.deshmukh exhaust_precreations fn for CMD - using get_mds_dir --- lustre/tests/sanity.sh | 25 ++++++++++++++++--------- lustre/tests/test-framework.sh | 4 ++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 69e3833..eb4ade8 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -937,21 +937,28 @@ reset_enospc() { } exhaust_precreations() { - OSTIDX=$1 + local OSTIDX=$1 + local MDSIDX=$(get_mds_dir "$DIR/d27") + echo OSTIDX=$OSTIDX MDSIDX=$MDSIDX + + local OST=$(lfs osts | grep ${OSTIDX}": " | awk '{print $2}' | sed -e 's/_UUID$//') + local MDT_INDEX=$(lfs df | grep "\[MDT:$((MDSIDX - 1))\]" | awk '{print $1}' | \ + sed -e 's/_UUID$//;s/^.*-//') - OST=$(lfs osts | grep ${OSTIDX}": " | \ - awk '{print $2}' | sed -e 's/_UUID$//') # on the mdt's osc - last_id=$(do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_last_id) - next_id=$(do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_next_id) + local last_id=$(do_facet mds${MDSIDX} lctl get_param -n osc.*${OST}-osc-${MDT_INDEX}.prealloc_last_id) + local next_id=$(do_facet mds${MDSIDX} lctl get_param -n osc.*${OST}-osc-${MDT_INDEX}.prealloc_next_id) + + echo ${OST}-osc-${MDT_INDEX}.prealloc_last_id=$last_id + echo ${OST}-osc-${MDT_INDEX}.prealloc_next_id=$next_id - mkdir -p $DIR/d27/${OST} - $SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1 + mkdir -p $DIR/d27 + $SETSTRIPE $DIR/d27 -i $OSTIDX -c 1 #define OBD_FAIL_OST_ENOSPC 0x215 do_facet ost$((OSTIDX + 1)) lctl set_param fail_loc=0x215 echo "Creating to objid $last_id on ost $OST..." - createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2)) - do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc* | grep '[0-9]' + createmany -o $DIR/d27/${OST}-f $next_id $((last_id - next_id + 2)) + do_facet mds${MDSIDX} lctl get_param osc.*${OST}-osc-${MDT_INDEX}.prealloc* | grep '[0-9]' reset_enospc $2 } diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 07430ff..5da512a 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2349,7 +2349,7 @@ get_stripe_info() { # CMD: determine mds index where directory inode presents get_mds_dir () { local dir=$1 - local file=$dir/$tfile + local file=$dir/f0.get_mds_dir_tmpfile rm -f $file local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') @@ -2364,7 +2364,7 @@ get_mds_dir () { for ((i=0; i<${#newused[@]}; i++)); do if [ ${oldused[$i]} -lt ${newused[$i]} ]; then echo $(( i + 1 )) - rm -f $dir/$tfile + rm -f $file return 0 fi done -- 1.8.3.1