From 3423b5b25a283cd488c570732bf2ffcb6e61a825 Mon Sep 17 00:00:00 2001 From: wang di Date: Wed, 26 Mar 2014 09:01:58 -0700 Subject: [PATCH] LU-4585 out: memset(ta, 0) will cause memory leak thandle_exec_args should not be memset to 0 in out_trans_start or out_handle, otherwise ta_args will never be released. Signed-off-by: wang di Change-Id: I3b6a8dc8c62af743015f6022afdeda14264574c8 Reviewed-on: http://review.whamcloud.com/9804 Tested-by: Jenkins Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/target/out_handler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/target/out_handler.c b/lustre/target/out_handler.c index 3cb6e83..b7dfd58 100644 --- a/lustre/target/out_handler.c +++ b/lustre/target/out_handler.c @@ -1299,7 +1299,7 @@ struct tgt_handler *out_handler_find(__u32 opc) static int out_tx_start(const struct lu_env *env, struct dt_device *dt, struct thandle_exec_args *ta, struct obd_export *exp) { - memset(ta, 0, sizeof(*ta)); + ta->ta_argno = 0; ta->ta_handle = dt_trans_create(env, dt); if (IS_ERR(ta->ta_handle)) { int rc; @@ -1346,6 +1346,8 @@ static int out_trans_stop(const struct lu_env *env, ta->ta_args[i]->object = NULL; } } + ta->ta_handle = NULL; + ta->ta_argno = 0; return rc; } @@ -1483,7 +1485,6 @@ int out_handle(struct tgt_session_info *tsi) tti->tti_u.update.tti_update_reply = reply; tti->tti_mult_trans = !req_is_replay(tgt_ses_req(tsi)); - memset(ta, 0, sizeof(*ta)); /* Walk through updates in the request to execute them synchronously */ for (i = 0; i < count; i++) { struct tgt_handler *h; -- 1.8.3.1