From a7934081ec184fd33577ed54059809999dd9d369 Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 23 Oct 2008 11:00:18 +0000 Subject: [PATCH] b=17447 r=adilger,deen - fixes existing and possible memory leaks; - cleanups. --- lustre/mds/mds_log.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lustre/mds/mds_log.c b/lustre/mds/mds_log.c index 21290e5..ca7fca0 100644 --- a/lustre/mds/mds_log.c +++ b/lustre/mds/mds_log.c @@ -200,6 +200,7 @@ int mds_llog_init(struct obd_device *obd, struct obd_device *tgt, int count, struct llog_catid *logid, struct obd_uuid *uuid) { struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct llog_ctxt *ctxt; int rc; ENTRY; @@ -211,13 +212,23 @@ int mds_llog_init(struct obd_device *obd, struct obd_device *tgt, rc = llog_setup(obd, LLOG_SIZE_REPL_CTXT, tgt, 0, NULL, &mds_size_repl_logops); if (rc) - RETURN(rc); + GOTO(err_llog, rc); rc = obd_llog_init(lov_obd, tgt, count, logid, uuid); - if (rc) + if (rc) { CERROR("lov_llog_init err %d\n", rc); - + GOTO(err_cleanup, rc); + } RETURN(rc); +err_cleanup: + ctxt = llog_get_context(obd, LLOG_SIZE_REPL_CTXT); + if (ctxt) + llog_cleanup(ctxt); +err_llog: + ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT); + if (ctxt) + llog_cleanup(ctxt); + return rc; } int mds_llog_finish(struct obd_device *obd, int count) -- 1.8.3.1