Whamcloud - gitweb
LU-8575 lod: clear ost usable flag to avoid striping. 67/22367/3
authorJadhav Vikram <jadhav.vikram@seagate.com>
Fri, 5 Feb 2016 04:07:07 +0000 (09:37 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 13 Oct 2016 23:36:28 +0000 (23:36 +0000)
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 <jadhav.vikram@seagate.com>
Change-Id: I6dd16c44b331b09a0ffee530b3eb8508bde64294
Reviewed-on: http://es-gerrit.xyus.xyratex.com:8080/9757
Tested-by: Jenkins
Reviewed-by: Ujjwal Lanjewar <ujjwal.lanjewar@seagate.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@seagate.com>
Tested-by: Elena V. Gryaznova <elena.gryaznova@seagate.com>
Reviewed-on: http://review.whamcloud.com/22367
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_qos.c
lustre/tests/sanity.sh

index 9159b11..1288bab 100644 (file)
@@ -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;
 
                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 */
                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;
 
                                   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;
                ost->ltd_qos.ltq_usable = 1;
                lod_qos_calc_weight(lod, osts->op_array[i]);
                total_weight += ost->ltd_qos.ltq_weight;
index 810f99d..c61e3bc 100755 (executable)
@@ -1650,7 +1650,7 @@ test_27u() { # bug 4900
        createmany -o $DIR/$tdir/t- 1000
        do_nodes $list $LCTL set_param fail_loc=0
 
        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
        $GETSTRIPE $DIR/$tdir > $TLOG
        OBJS=$(awk -vobj=0 '($1 == 0) { obj += 1 } END { print obj; }' $TLOG)
        unlinkmany $DIR/$tdir/t- 1000