From: Jadhav Vikram Date: Fri, 5 Feb 2016 04:07:07 +0000 (+0530) Subject: LU-8575 lod: clear ost usable flag to avoid striping. X-Git-Tag: 2.8.60~59 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=661b77206cb27ada29921c07215365bbd5db58c2;hp=bd1441b92e31cd3c01cc2453aa627d139a1207f7 LU-8575 lod: clear ost usable flag to avoid striping. clear ost->ltd_qos.ltq_usable before checking OBD_FAIL_MDS_OSC_PRECREATE param and some other flags in lod_alloc_qos() while finding all ost's which are valid stripe candidates. Call to lod_alloc_qos before setting this flag/param sets ost->ltd_qos.ltq_usable to 1 for all valid ost but after setting this flag/param ost->ltd_qos.ltq_usable not getting cleared so there is need to clear it so that it will not get added into stripe array. Also in test_27u corrects problem where log file gets created in lustre mount directory instead of /tmp. This make sures TLOG file will not get created on ost0. Seagate-bug-id: MRP-2847 Signed-off-by: Jadhav Vikram Change-Id: I6dd16c44b331b09a0ffee530b3eb8508bde64294 Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/9757 Tested-by: Jenkins Reviewed-by: Ujjwal Lanjewar Reviewed-by: Vladimir Saveliev Tested-by: Elena V. Gryaznova Reviewed-on: http://review.whamcloud.com/22367 Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 9159b11..1288bab 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -1405,6 +1405,9 @@ static int lod_alloc_qos(const struct lu_env *env, struct lod_object *lo, if (!cfs_bitmap_check(lod->lod_ost_bitmap, osts->op_array[i])) continue; + ost = OST_TGT(lod, osts->op_array[i]); + ost->ltd_qos.ltq_usable = 0; + rc = lod_statfs_and_check(env, lod, osts->op_array[i], sfs); if (rc) { /* this OSP doesn't feel well */ @@ -1420,7 +1423,6 @@ static int lod_alloc_qos(const struct lu_env *env, struct lod_object *lo, osts->op_array[i] == 0) continue; - ost = OST_TGT(lod, osts->op_array[i]); ost->ltd_qos.ltq_usable = 1; lod_qos_calc_weight(lod, osts->op_array[i]); total_weight += ost->ltd_qos.ltq_weight; diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 810f99d..c61e3bc 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1650,7 +1650,7 @@ test_27u() { # bug 4900 createmany -o $DIR/$tdir/t- 1000 do_nodes $list $LCTL set_param fail_loc=0 - TLOG=$DIR/$tfile.getstripe + TLOG=$TMP/$tfile.getstripe $GETSTRIPE $DIR/$tdir > $TLOG OBJS=$(awk -vobj=0 '($1 == 0) { obj += 1 } END { print obj; }' $TLOG) unlinkmany $DIR/$tdir/t- 1000