X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flod%2Flod_qos.c;h=cd7b7f5c1a4b2128302739001e2854046583c212;hb=5ebc00ec79565ad62e978af65b023343ad360675;hp=d064f62f8f74324751994cf90f401609a6dcb32b;hpb=9281658095a63c88a12246df5fb6f3b78f97095a;p=fs%2Flustre-release.git diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index d064f62..cd7b7f5 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -212,6 +212,9 @@ static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d, 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; @@ -228,6 +231,7 @@ static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d, 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; @@ -939,6 +943,7 @@ static int lod_alloc_rr(const struct lu_env *env, struct lod_object *lo, 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); @@ -1014,11 +1019,16 @@ repeat_find: 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; } @@ -1031,7 +1041,10 @@ repeat_find: rc = 0; } else { /* nobody provided us with a single object */ - rc = -ENOSPC; + if (ost_connecting) + rc = -EINPROGRESS; + else + rc = -ENOSPC; } out: