From ac2dad95f05b2bfd7a49a22fb5482fd41480e1dd Mon Sep 17 00:00:00 2001 From: yury Date: Mon, 14 Mar 2005 19:16:37 +0000 Subject: [PATCH] - memory leak fixes from b_fid. --- lustre/lmv/lmv_objmgr.c | 12 +++++++++--- lustre/mds/mds_reint.c | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/lmv/lmv_objmgr.c b/lustre/lmv/lmv_objmgr.c index ce054c7..07057b1 100644 --- a/lustre/lmv/lmv_objmgr.c +++ b/lustre/lmv/lmv_objmgr.c @@ -297,7 +297,9 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) CDEBUG(D_OTHER, "get mea for "DLID4" and create lmv obj\n", OLID4(id)); - if (!mea) { + md.mea = NULL; + + if (mea != NULL) { __u64 valid; CDEBUG(D_OTHER, "mea isn't passed in, get it now\n"); @@ -320,7 +322,7 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) GOTO(cleanup, obj = ERR_PTR(rc)); } - if (!md.mea) + if (md.mea == NULL) GOTO(cleanup, obj = ERR_PTR(-ENODATA)); mea = md.mea; @@ -333,7 +335,11 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) OLID4(id)); GOTO(cleanup, obj = ERR_PTR(-ENOMEM)); } - EXIT; + + if (md.mea != NULL) + obd_free_memmd(exp, (struct lov_stripe_md **)&md.mea); + + EXIT; cleanup: if (req) ptlrpc_req_finished(req); diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index df39b7b..46072cf 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -85,6 +85,7 @@ static void mds_cancel_cookies_cb(struct obd_device *obd, sizeof(*mlcd->mlcd_cookies)), rc); } + obd_free_memmd(obd->u.mds.mds_dt_exp, &lsm); OBD_FREE(mlcd, mlcd->mlcd_size); } -- 1.8.3.1