Whamcloud - gitweb
more checks for NULL lov_tgts for avoid oops.
authorshadow <shadow>
Thu, 17 Jan 2008 21:50:06 +0000 (21:50 +0000)
committershadow <shadow>
Thu, 17 Jan 2008 21:50:06 +0000 (21:50 +0000)
b=14607
i=umka
i=tappro

lustre/ChangeLog
lustre/lov/lov_qos.c
lustre/lov/lproc_lov.c

index 66f5b10..bd061ea 100644 (file)
@@ -17,6 +17,11 @@ tbd  Sun Microsystems, Inc.
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
+Severity   : normal
+Bugzilla   : 14607
+Description: NULL lov_tgts causing MDS oops
+Details    : more safe checks for NULL lov_tgts for avoid oops.
+
 Severity   : enhancement
 Bugzilla   : 14531
 Description: Update to RHEL4 latest kernel-2.6.9-67.0.1.EL.
index ad2a2f9..87123c8 100644 (file)
@@ -369,7 +369,7 @@ static int qos_calc_rr(struct lov_obd *lov)
                               lov->lov_qos.lq_rr_array[next] = i;
                               j++;
                               placed++;
-                      }
+                        }
                 }
                 LASSERT(j == oss->lqo_ost_count);
         }
index f725d3b..615dd88 100644 (file)
@@ -264,8 +264,12 @@ static void *lov_tgt_seq_start(struct seq_file *p, loff_t *pos)
         struct obd_device *dev = p->private;
         struct lov_obd *lov = &dev->u.lov;
 
-        return (*pos >= lov->desc.ld_tgt_count) ? NULL : lov->lov_tgts[*pos];
-
+        while (*pos < lov->desc.ld_tgt_count) {
+                if (lov->lov_tgts[*pos])
+                        return lov->lov_tgts[*pos];
+                ++*pos;
+        }
+        return NULL;
 }
 
 static void lov_tgt_seq_stop(struct seq_file *p, void *v)