spin_unlock(&d->lod_desc_lock);
} else if (rc == 0 && ost->ltd_active == 0) {
/* turned active? */
- LASSERT(d->lod_desc.ld_active_tgt_count < d->lod_ostnr);
+ LASSERTF(d->lod_desc.ld_active_tgt_count < d->lod_ostnr,
+ "active tgt count %d, ost nr %d\n",
+ d->lod_desc.ld_active_tgt_count, d->lod_ostnr);
spin_lock(&d->lod_desc_lock);
if (ost->ltd_active == 0) {
ost->ltd_active = 1;
spin_unlock(&d->lod_desc_lock);
}
- return rc;
+ RETURN(rc);
}
static void lod_qos_statfs_update(const struct lu_env *env,
out:
up_write(&lod->lod_qos.lq_rw_sem);
+ EXIT;
}
/* Recalculate per-object penalties for OSSs and OSTs,
* no striping has been created so far
*/
LASSERT(lo->ldo_stripenr > 0);
+ /*
+ * statfs and check OST targets now, since ld_active_tgt_count
+ * could be changed if some OSTs are [de]activated manually.
+ */
+ lod_qos_statfs_update(env, d);
lo->ldo_stripenr = lod_get_stripecnt(d, LOV_MAGIC,
lo->ldo_stripenr);
lod_getref(&d->lod_ost_descs);
/* XXX: support for non-0 files w/o objects */
+ CDEBUG(D_OTHER, "tgt_count %d stripenr %d\n",
+ d->lod_desc.ld_tgt_count, stripe_len);
if (lo->ldo_def_stripe_offset >= d->lod_desc.ld_tgt_count) {
- lod_qos_statfs_update(env, d);
rc = lod_alloc_qos(env, lo, stripe, flag, th);
if (rc == -EAGAIN)
rc = lod_alloc_rr(env, lo, stripe, flag, th);
do_facet $SINGLEMDS lctl --device %$OSC activate
fi
done
+
+ # all osp devices get activated, hence -1 stripe count restored
+ local stripecnt=0
+
+ # sleep 2*lod_qos_maxage seconds waiting for lod qos to notice osp
+ # devices get activated.
+ sleep_maxage
+ $SETSTRIPE -c -1 $DIR/$tfile
+ stripecnt=$($GETSTRIPE -c $DIR/$tfile)
+ rm -f $DIR/$tfile
+ [ $stripecnt -ne $OSTCOUNT ] &&
+ error "Of $OSTCOUNT OSTs, only $stripecnt is available"
+ return 0
}
run_test 27y "create files while OST0 is degraded and the rest inactive"