X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flov%2Flov_qos.c;h=c21f8b00361bf224639e9e6c1c22b3e922d2a9ec;hb=f3b4ffc8033679809e51f27314b0bf3894063548;hp=de2ae533117941933cfe5893c1eb824a31852f2c;hpb=da2854ef4e519899c128f2d32388fb28bdf31993;p=fs%2Flustre-release.git diff --git a/lustre/lov/lov_qos.c b/lustre/lov/lov_qos.c index de2ae53..c21f8b0 100644 --- a/lustre/lov/lov_qos.c +++ b/lustre/lov/lov_qos.c @@ -566,8 +566,7 @@ repeat_find: continue; /* Drop slow OSCs if we can */ - if (obd_precreate(lov->lov_tgts[ost_idx]->ltd_exp, speed == 0) > - speed) + if (obd_precreate(lov->lov_tgts[ost_idx]->ltd_exp) > speed) continue; *idx_pos = ost_idx; @@ -613,8 +612,8 @@ repeat_find: continue; /* Drop slow OSCs if we can */ - if (obd_precreate(lov->lov_tgts[ost_idx]->ltd_exp, speed == 0) > - speed) + if ((obd_precreate(lov->lov_tgts[ost_idx]->ltd_exp) > speed) && + (i != 0 || speed < 2)) continue; *idx_pos = ost_idx; @@ -682,9 +681,9 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt, GOTO(out_up_write, rc = -EAGAIN); rc = qos_calc_ppo(exp->exp_obd); - if (rc) + if (rc) GOTO(out_up_write, rc); - + total_bavail = 0; good_osts = 0; /* Warn users about zero available space/inode every 30 min */ @@ -693,7 +692,7 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt, /* Find all the OSTs that are valid stripe candidates */ for (i = 0; i < ost_count; i++) { __u64 bavail; - + if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) continue; bavail = TGT_BAVAIL(i); @@ -719,7 +718,7 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt, if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && i == 0) continue; - if (obd_precreate(lov->lov_tgts[i]->ltd_exp, 1) > 2) + if (obd_precreate(lov->lov_tgts[i]->ltd_exp) > 2) continue; lov->lov_tgts[i]->ltd_qos.ltq_usable = 1; @@ -730,12 +729,12 @@ static int alloc_qos(struct obd_export *exp, int *idx_arr, int *stripe_cnt, good_osts++; } + if (good_osts < stripe_cnt_min) + GOTO(out_up_write, rc = -EAGAIN); + if (!total_bavail) GOTO(out_up_write, rc = -ENOSPC); - if (good_osts < stripe_cnt_min) - GOTO(out_up_write, rc = -EAGAIN); - /* We have enough osts */ if (good_osts < *stripe_cnt) *stripe_cnt = good_osts;