run_test 27m "create file while OST0 was full =================="
sleep_maxage() {
- local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | awk '{print $1 + 2}')
+ local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 + 5}')
sleep $DELAY
}
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
+ do_facet mds${MDSIDX} lctl get_param osc.*OST*-osc-${MDT_INDEX}.prealloc*
- mkdir -p $DIR/d27
- $SETSTRIPE $DIR/d27 -i $OSTIDX -c 1
+ mkdir -p $DIR/d27/${OST}
+ $SETSTRIPE $DIR/d27/${OST} -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 mds${MDSIDX} lctl get_param osc.*${OST}-osc-${MDT_INDEX}.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*
reset_enospc $2 $OSTIDX
}
exhaust_precreations 0 0x80000215
echo foo >> $DIR/d27/f27p || error "append failed"
$CHECKSTAT -s 80000004 $DIR/d27/f27p || error "checkstat failed"
+ $LFS getstripe $DIR/d27/f27p
reset_enospc
}
test_27w() { # bug 10997
mkdir -p $DIR/d27w || error "mkdir failed"
$LSTRIPE $DIR/d27w/f0 -s 65536 || error "lstripe failed"
- size=`$GETSTRIPE $DIR/d27w/f0 -qs`
+ size=`$GETSTRIPE $DIR/d27w/f0 -qs | head -n 1`
[ $size -ne 65536 ] && error "stripe size $size != 65536" || true
[ "$OSTCOUNT" -lt "2" ] && skip_env "skipping multiple stripe count/offset test" && return
for i in `seq 1 $OSTCOUNT`; do
offset=$(($i-1))
$LSTRIPE $DIR/d27w/f$i -c $i -i $offset || error "lstripe -c $i -i $offset failed"
- count=`$GETSTRIPE -qc $DIR/d27w/f$i`
- index=`$GETSTRIPE -qo $DIR/d27w/f$i`
+ count=`$GETSTRIPE -qc $DIR/d27w/f$i | head -n 1`
+ index=`$GETSTRIPE -qo $DIR/d27w/f$i | head -n 1`
[ $count -ne $i ] && error "stripe count $count != $i" || true
[ $index -ne $offset ] && error "stripe offset $index != $offset" || true
done