Whamcloud - gitweb
b=22888 fix memory leak in handle_recovery_req() when export disconnected already
authorFan Yong <Yong.Fan@sun.com>
Thu, 22 Jul 2010 01:22:12 +0000 (05:22 +0400)
committerMikhail Pershin <tappro@sun.com>
Mon, 26 Jul 2010 19:46:12 +0000 (23:46 +0400)
fix memory leak in handle_recovery_req() when export disconnected already

i=Mikhail.Pershin
i=landen

lustre/ldlm/ldlm_lib.c

index 16578d8..37b6452 100644 (file)
@@ -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);