From: vitaly Date: Thu, 21 Sep 2006 19:04:35 +0000 (+0000) Subject: Branch b_new_cmd X-Git-Tag: v1_8_0_110~486^2~873 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5b70a8943e0bdffd8f82cfa51bd1281faa54ca3a;p=fs%2Flustre-release.git Branch b_new_cmd bugfix for the memleak in ll_revalidate_it bugfix for the memleak in mdt_destroy_export --- diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index 9c40c36..590010d 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -462,6 +462,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, if it would be, we'll reopen the open request to MDS later during file open path */ up(&lli->lli_och_sem); + OBD_FREE_PTR(op_data); RETURN(1); } else { up(&lli->lli_och_sem); @@ -599,8 +600,10 @@ do_lookup: DLM_REPLY_REC_OFF, sizeof(*mdt_body)); /* see if we got same inode, if not - return error */ - if(lu_fid_eq(&op_data->fid2, &mdt_body->fid1)) + if(lu_fid_eq(&op_data->fid2, &mdt_body->fid1)) { + OBD_FREE_PTR(op_data); goto revalidate_finish; + } ll_intent_release(it); } OBD_FREE_PTR(op_data); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index d26f121..efd7e6a 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3318,8 +3318,8 @@ static int mdt_destroy_export(struct obd_export *export) ma = &info->mti_attr; ma->ma_lmm_size = mdt->mdt_max_mdsize; ma->ma_cookie_size = mdt->mdt_max_cookiesize; - OBD_ALLOC(ma->ma_lmm, ma->ma_lmm_size); - OBD_ALLOC(ma->ma_cookie, ma->ma_cookie_size); + OBD_ALLOC(ma->ma_lmm, mdt->mdt_max_mdsize); + OBD_ALLOC(ma->ma_cookie, mdt->mdt_max_cookiesize); if (ma->ma_lmm == NULL || ma->ma_cookie == NULL) GOTO(out, rc = -ENOMEM); @@ -3350,9 +3350,9 @@ static int mdt_destroy_export(struct obd_export *export) out: if (ma->ma_lmm) - OBD_FREE(ma->ma_lmm, ma->ma_lmm_size); + OBD_FREE(ma->ma_lmm, mdt->mdt_max_mdsize); if (ma->ma_cookie) - OBD_FREE(ma->ma_cookie, ma->ma_cookie_size); + OBD_FREE(ma->ma_cookie, mdt->mdt_max_cookiesize); lu_context_exit(&ctxt); lu_context_fini(&ctxt);