From eda9953812e2a582648eb7b5cca4aeabd9aa19cd Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 17 Jan 2008 21:50:06 +0000 Subject: [PATCH] more checks for NULL lov_tgts for avoid oops. b=14607 i=umka i=tappro --- lustre/ChangeLog | 5 +++++ lustre/lov/lov_qos.c | 2 +- lustre/lov/lproc_lov.c | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 66f5b10..bd061ea 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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. diff --git a/lustre/lov/lov_qos.c b/lustre/lov/lov_qos.c index ad2a2f9..87123c8 100644 --- a/lustre/lov/lov_qos.c +++ b/lustre/lov/lov_qos.c @@ -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); } diff --git a/lustre/lov/lproc_lov.c b/lustre/lov/lproc_lov.c index f725d3b..615dd88 100644 --- a/lustre/lov/lproc_lov.c +++ b/lustre/lov/lproc_lov.c @@ -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) -- 1.8.3.1