# OSCs keep a NOSPC flag that will be reset after ~5s (qos_maxage)
# if the OST isn't full anymore.
reset_enospc() {
- local OSTIDX=${1:-""}
+ local ostidx=${1:-""}
+ local delay
+ local ready
+ local get_prealloc
local list=$(comma_list $(osts_nodes))
- [ "$OSTIDX" ] && list=$(facet_host ost$((OSTIDX + 1)))
+ [ "$ostidx" ] && list=$(facet_host ost$((ostidx + 1)))
do_nodes $list lctl set_param fail_loc=0
- sync # initiate all OST_DESTROYs from MDS to OST
- sleep_maxage
+ wait_delete_completed # initiate all OST_DESTROYs from MDS to OST
+ delay=$(do_facet $SINGLEMDS lctl get_param -n lov.*.qos_maxage |
+ awk '{print $1 * 2;exit;}')
+ get_prealloc="$LCTL get_param -n osc.*MDT*.prealloc_status |
+ grep -v \"^0$\""
+ wait_update_facet $SINGLEMDS "$get_prealloc" "" $delay
}
-exhaust_precreations() {
+__exhaust_precreations() {
local OSTIDX=$1
local FAILLOC=$2
local FAILIDX=${3:-$OSTIDX}
createmany -o $DIR/$tdir/${OST}/f $next_id $((last_id - next_id + 2))
do_facet $mfacet lctl get_param osp.$mdtosc_proc2.prealloc*
do_facet $ofacet lctl set_param fail_loc=$FAILLOC
+}
+
+exhaust_precreations() {
+ __exhaust_precreations $1 $2 $3
sleep_maxage
}
exhaust_all_precreations() {
local i
for (( i=0; i < OSTCOUNT; i++ )) ; do
- exhaust_precreations $i $1 -1
+ __exhaust_precreations $i $1 -1
done
+ sleep_maxage
}
test_27n() {