test_27a() {
echo '== stripe sanity =============================================='
mkdir -p $DIR/d27 || error "mkdir failed"
+ $GETSTRIPE $DIR/d27
$SETSTRIPE $DIR/d27/f0 -c 1 || error "lstripe failed"
$CHECKSTAT -t file $DIR/d27/f0 || error "checkstat failed"
pass
# osc's keep a NOSPC stick flag that gets unset with rmdir
reset_enospc() {
- [ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0
+ local FAIL_LOC=${1:-0}
+ local OSTIDX=${2:-""}
+
mkdir -p $DIR/d27/nospc
rmdir $DIR/d27/nospc
- do_nodes $(comma_list $(osts_nodes)) lctl set_param fail_loc=$FAIL_LOC
+ local list=$(comma_list $(osts_nodes))
+ [ "$OSTIDX" ] && \
+ { var=ost$((OSTIDX + 1))_HOST && list=${!var}; }
+
+ do_nodes $list lctl set_param fail_loc=$FAIL_LOC
}
exhaust_precreations() {
- OSTIDX=$1
+ local OSTIDX=$1
+
+ local OST=$(lfs osts | grep ${OSTIDX}": " | \
+ awk '{print $2}' | sed -e 's/_UUID$//')
- OST=$(lfs osts | grep ${OSTIDX}": " | \
- awk '{print $2}' | sed -e 's/_UUID$//')
# on the mdt's osc
- last_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_last_id)
- next_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_next_id)
+ local last_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_last_id)
+ local next_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_next_id)
mkdir -p $DIR/d27/${OST}
$SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1
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 "lctl get_param -n osc.${OST}-osc.prealloc*" | grep '[0-9]'
- reset_enospc $2
+ reset_enospc $2 $OSTIDX
}
exhaust_all_precreations() {
reset_enospc
rm -f $DIR/d27/f27n
+ $SETSTRIPE $DIR/d27 -c 1 -i -1
exhaust_precreations 0 0x80000215
touch $DIR/d27/f27n || error
test_27s() { # bug 10725
mkdir -p $DIR/$tdir
- $LSTRIPE $DIR/$tdir $((4096 * 1024 * 1024)) -1 2 && \
+ local stripe_size=$((4096 * 1024 * 1024)) # 2^32
+ local stripe_count=0
+ [ $OSTCOUNT -eq 1 ] || stripe_count=2
+ $SETSTRIPE $DIR/$tdir -s $stripe_size -c $stripe_count && \
error "stripe width >= 2^32 succeeded" || true
}
run_test 27s "lsm_xfersize overflow (should error) (bug 10725)"
touch $DIR/$tdir/$tfile
#define OBD_FAIL_TGT_DELAY_PRECREATE 0x705
- lctl set_param fail_loc=0x705
- START=`date +%s`
- for F in `seq 1 32`; do
- touch $DIR/$tdir/$tfile.$F
+ # all except ost1
+ for (( i=0; i < OSTCOUNT; i++ )) ; do
+ do_facet ost$i lctl set_param fail_loc=0x705
done
- lctl set_param fail_loc=0
+ local START=`date +%s`
+ createmany -o $DIR/$tdir/$tfile 32
+
+ reset_enospc
- FINISH=`date +%s`
- TIMEOUT=`lctl get_param -n timeout`
+ local FINISH=`date +%s`
+ local TIMEOUT=`lctl get_param -n timeout`
[ $((FINISH - START)) -ge $((TIMEOUT / 2)) ] && \
error "$FINISH - $START >= $TIMEOUT / 2"