Whamcloud - gitweb
LU-13229 ldlm: unlock request memory leak 70/37670/2
authorAlexey Lyashkov <c17817@cray.com>
Fri, 21 Feb 2020 15:36:42 +0000 (18:36 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 Mar 2020 22:35:12 +0000 (22:35 +0000)
resending an unlock request can caused an memory leak as new request
will allocated on resend. Lets finish a request before resend.

Fixes: 85a12c6c8d7 ("LU-12828 ldlm: FLOCK request can be processed twice")
Cray-bug-id: LUS-8447
Signed-off-by: Alexey Lyashkov <c17817@cray.com>
Change-Id: I15dfe0388d1305c8eb5be18b19b0ffc687454ef1
Reviewed-on: https://review.whamcloud.com/37670
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/mdc_locks.c

index 574d09b..e3b04b0 100644 (file)
@@ -987,11 +987,11 @@ resend:
                   can not rely on caller and this mainly for F_UNLCKs
                   (explicits or automatically generated by Kernel to clean
                   current FLocks upon exit) that can't be trashed */
+               ptlrpc_req_finished(req);
                if (((rc == -EINTR) || (rc == -ETIMEDOUT)) &&
                    (einfo->ei_type == LDLM_FLOCK) &&
                    (einfo->ei_mode == LCK_NL))
                        goto resend;
-               ptlrpc_req_finished(req);
                RETURN(rc);
        }