Whamcloud - gitweb
Branch: b1_6
authorwangdi <wangdi>
Thu, 28 Jun 2007 05:13:39 +0000 (05:13 +0000)
committerwangdi <wangdi>
Thu, 28 Jun 2007 05:13:39 +0000 (05:13 +0000)
Checking whether lov_tgts is NULL in some lov funcations.
b=12576
i=adilger
i=shadow

lustre/ChangeLog
lustre/lov/lov_obd.c

index 82f4e7a..f11b074 100644 (file)
@@ -391,6 +391,11 @@ Bugzilla   : 12646
 Description: sanity.sh test_77h fails with "test_77h file compare failed"
 Details    : test_77h uses a file which was messed by other test case.
 
+Severity   : normal
+Bugzilla   : 12576
+Description: Not Check whether lov_tgts is NULL in some lov functions
+Details    : Checking whether lov_tgts is NULL in some functions. 
+
 --------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <info@clusterfs.com>
index f03b82a..765e328 100644 (file)
@@ -1944,6 +1944,10 @@ static int lov_change_cbdata(struct obd_export *exp,
                 struct lov_stripe_md submd;
 
                 loi = lsm->lsm_oinfo[i];
+                if (!lov->lov_tgts[loi->loi_ost_idx]) {
+                        CDEBUG(D_HA, "lov idx %d NULL \n", loi->loi_ost_idx);
+                        continue;
+                }
                 submd.lsm_object_id = loi->loi_id;
                 submd.lsm_stripe_count = 0;
                 rc = obd_change_cbdata(lov->lov_tgts[loi->loi_ost_idx]->ltd_exp,
@@ -2029,8 +2033,12 @@ static int lov_cancel_unused(struct obd_export *exp,
                 int err;
 
                 loi = lsm->lsm_oinfo[i];
-                if (!lov->lov_tgts[loi->loi_ost_idx] || 
-                    !lov->lov_tgts[loi->loi_ost_idx]->ltd_active)
+                if (!lov->lov_tgts[loi->loi_ost_idx]) {
+                        CDEBUG(D_HA, "lov idx %d NULL\n", loi->loi_ost_idx);
+                        continue;
+                }
+
+                if (!lov->lov_tgts[loi->loi_ost_idx]->ltd_active)
                         CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
 
                 submd.lsm_object_id = loi->loi_id;
@@ -2066,8 +2074,12 @@ static int lov_join_lru(struct obd_export *exp,
                 int rc = 0;
 
                 loi = lsm->lsm_oinfo[i];
-                if (!lov->lov_tgts[loi->loi_ost_idx] || 
-                    !lov->lov_tgts[loi->loi_ost_idx]->ltd_active)
+                if (!lov->lov_tgts[loi->loi_ost_idx]) {
+                        CDEBUG(D_HA, "lov idx %d NULL\n", loi->loi_ost_idx);
+                        continue;
+                }
+
+                if (!lov->lov_tgts[loi->loi_ost_idx]->ltd_active)
                         CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
 
                 submd.lsm_object_id = loi->loi_id;