unsigned long ltd_active:1,/* is this target up for requests */
ltd_activate:1,/* should target be activated */
ltd_reap:1, /* should this target be deleted */
- ltd_got_update_log:1; /* Already got update log */
+ ltd_got_update_log:1, /* Already got update log */
+ ltd_connecting:1; /* target is connecting */
};
#define TGT_PTRS 256 /* number of pointers at 1st level */
spin_lock(&d->lod_desc_lock);
if (ost->ltd_active) {
ost->ltd_active = 0;
+ if (rc == -ENOTCONN)
+ ost->ltd_connecting = 1;
+
LASSERT(d->lod_desc.ld_active_tgt_count > 0);
d->lod_desc.ld_active_tgt_count--;
d->lod_qos.lq_dirty = 1;
spin_lock(&d->lod_desc_lock);
if (ost->ltd_active == 0) {
ost->ltd_active = 1;
+ ost->ltd_connecting = 0;
d->lod_desc.ld_active_tgt_count++;
d->lod_qos.lq_dirty = 1;
d->lod_qos.lq_rr.lqr_dirty = 1;
int rc;
__u32 ost_start_idx_temp;
int speed = 0;
+ int ost_connecting = 0;
__u32 stripe_idx = 0;
__u32 stripe_cnt = lo->ldo_stripenr;
__u32 stripe_cnt_min = min_stripe_count(stripe_cnt, flags);
rc = lod_check_and_reserve_ost(env, m, sfs, ost_idx, speed,
&stripe_idx, stripe, th);
spin_lock(&lqr->lqr_alloc);
+
+ if (rc != 0 && OST_TGT(m, ost_idx)->ltd_connecting)
+ ost_connecting = 1;
}
if ((speed < 2) && (stripe_idx < stripe_cnt_min)) {
/* Try again, allowing slower OSCs */
speed++;
lqr->lqr_start_idx = ost_start_idx_temp;
+
+ ost_connecting = 0;
goto repeat_find;
}
rc = 0;
} else {
/* nobody provided us with a single object */
- rc = -ENOSPC;
+ if (ost_connecting)
+ rc = -EINPROGRESS;
+ else
+ rc = -ENOSPC;
}
out:
struct obd_statfs *sfs)
{
struct osp_device *d = dt2osp_dev(dev);
+ struct obd_import *imp = d->opd_obd->u.cli.cl_import;
ENTRY;
+ if (imp->imp_state == LUSTRE_IMP_CLOSED)
+ RETURN(-ESHUTDOWN);
+
if (unlikely(d->opd_imp_active == 0))
RETURN(-ENOTCONN);