From 0152977c7d76f88d44223229c4982b9c6afd61ee Mon Sep 17 00:00:00 2001 From: Jeremy Filizetti Date: Mon, 4 Jun 2012 20:14:19 -0400 Subject: [PATCH] LU-1459 llite: Don't use unitialized variable Currently lov_connect_obd prints warning messages using an unitialized stack variable. The message also only prints a uuid instead of a meaningful target name. Signed-off-by: Jeremy Filizetti Change-Id: I7549acdd45ab70e3528d2f0c153a27a502b0404a Reviewed-on: http://review.whamcloud.com/2992 Tested-by: Hudson Reviewed-by: Bobi Jam Tested-by: Maloo Reviewed-by: Johann Lombardi --- lustre/lov/lov_obd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 3194f45..ceadeb3 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -267,7 +267,7 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, struct obd_connect_data *data) { struct lov_obd *lov = &obd->u.lov; - struct obd_uuid tgt_uuid; + struct obd_uuid *tgt_uuid; struct obd_device *tgt_obd; struct obd_uuid lov_osc_uuid = { "LOV_OSC_UUID" }; struct lustre_handle conn = {0, }; @@ -281,9 +281,10 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, if (!lov->lov_tgts[index]) RETURN(-EINVAL); - tgt_obd = lov->lov_tgts[index]->ltd_obd; + tgt_uuid = &lov->lov_tgts[index]->ltd_uuid; + tgt_obd = lov->lov_tgts[index]->ltd_obd; if (!tgt_obd->obd_set_up) { - CERROR("Target %s not set up\n", obd_uuid2str(&tgt_uuid)); + CERROR("Target %s not set up\n", obd_uuid2str(tgt_uuid)); RETURN(-EINVAL); } @@ -306,13 +307,13 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, if (rc) { CERROR("Target %s register_observer error %d; " "will not be able to reactivate\n", - obd_uuid2str(&tgt_uuid), rc); + obd_uuid2str(tgt_uuid), rc); RETURN(rc); } if (imp->imp_invalid) { CDEBUG(D_CONFIG, "not connecting OSC %s; administratively " - "disabled\n", obd_uuid2str(&tgt_uuid)); + "disabled\n", obd_uuid2str(tgt_uuid)); RETURN(0); } if (lov->lov_lock_cancel_cb) @@ -329,7 +330,7 @@ static int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid, data, &lov->lov_tgts[index]->ltd_exp); if (rc || !lov->lov_tgts[index]->ltd_exp) { CERROR("Target %s connect error %d\n", - obd_uuid2str(&tgt_uuid), rc); + obd_uuid2str(tgt_uuid), rc); GOTO(out_page_cb, rc); } -- 1.8.3.1