From 1b25d7b35147e6f2042bb941c7886082e60056d4 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Thu, 22 Jul 2010 05:22:12 +0400 Subject: [PATCH] b=22888 fix memory leak in handle_recovery_req() when export disconnected already fix memory leak in handle_recovery_req() when export disconnected already i=Mikhail.Pershin i=landen --- lustre/ldlm/ldlm_lib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 16578d8..37b6452 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1659,17 +1659,18 @@ static int handle_recovery_req(struct ptlrpc_thread *thread, int rc; ENTRY; - rc = lu_context_init(&req->rq_recov_session, LCT_SESSION); - if (rc) { - CERROR("Failure to initialize session: %d\n", rc); - GOTO(reqcopy_put, rc); - } /** * export can be evicted during recovery, no need to handle replays for * it after that, discard such request silently */ if (req->rq_export->exp_disconnected) + GOTO(reqcopy_put, rc = 0); + + rc = lu_context_init(&req->rq_recov_session, LCT_SESSION); + if (rc) { + CERROR("Failure to initialize session: %d\n", rc); GOTO(reqcopy_put, rc); + } req->rq_recov_session.lc_thread = thread; lu_context_enter(&req->rq_recov_session); -- 1.8.3.1