From db56576c0e47a48150ba210878e7696cef92a89a Mon Sep 17 00:00:00 2001 From: shadow Date: Fri, 24 Oct 2008 05:04:11 +0000 Subject: [PATCH] Kill extra argument for llog_connect, and don't access to ld_tgt_count without protection. Branch b1_8_gate b=16693 i=umka i=tappro --- lustre/lov/lov_log.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/lov/lov_log.c b/lustre/lov/lov_log.c index eff8e77..59d2e9d 100644 --- a/lustre/lov/lov_log.c +++ b/lustre/lov/lov_log.c @@ -113,7 +113,7 @@ static int lov_llog_origin_add(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec, RETURN(rc); } -static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count, +static int lov_llog_origin_connect(struct llog_ctxt *ctxt, struct llog_logid *logid, struct llog_gen *gen, struct obd_uuid *uuid) @@ -124,7 +124,7 @@ static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count, ENTRY; lov_getref(obd); - for (i = 0; i < count; i++) { + for (i = 0; i < lov->desc.ld_tgt_count; i++) { struct obd_device *child; struct llog_ctxt *cctxt; @@ -132,10 +132,10 @@ static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count, continue; if (uuid && !obd_uuid_equals(uuid, &lov->lov_tgts[i]->ltd_uuid)) continue; - CDEBUG(D_CONFIG, "connect %d/%d\n", i, count); + CDEBUG(D_CONFIG, "connect %d/%d\n", i, lov->desc.ld_tgt_count); child = lov->lov_tgts[i]->ltd_exp->exp_obd; cctxt = llog_get_context(child, ctxt->loc_idx); - rc = llog_connect(cctxt, 1, logid, gen, uuid); + rc = llog_connect(cctxt, logid, gen, uuid); llog_ctxt_put(cctxt); if (rc) { -- 1.8.3.1