[LU-13229] Flock unlock request resend caused a memory leak. Created: 10/Feb/20  Updated: 05/Mar/20  Resolved: 05/Mar/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.14.0

Type: Bug Priority: Critical
Reporter: Alexey Lyashkov Assignee: Alexey Lyashkov
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

LU-12828 fix introduce a regression caused a request leak in the resend case.

@@ -922,6 +932,7 @@ resend:
                LASSERTF(einfo->ei_type == LDLM_FLOCK, “lock type %d\n”,
                         einfo->ei_type);
                res_id.name[3] = LDLM_FLOCK;
+               req = ldlm_enqueue_pack(exp, 0);
...
@@ -973,6 +971,7 @@ resend:
        rc = ldlm_cli_enqueue(exp, &req, einfo, &res_id, policy, &flags, NULL,
                              0, lvb_type, lockh, 0);
+
        if (!it) {
                /* For flock requests we immediatelly return without further
                   delay and let caller deal with the rest, since rest of
@@ -986,12 +985,10 @@ resend:
                    (einfo->ei_type == LDLM_FLOCK) &&
                    (einfo->ei_mode == LCK_NL))
                        goto resend;
+               ptlrpc_req_finished(req);
                RETURN(rc);
        }

So new request will allocated on resend case, but it don't freed in unlock resend case.



 Comments   
Comment by Gerrit Updater [ 21/Feb/20 ]

Alexey Lyashkov (alexey.lyashkov@hpe.com) uploaded a new patch: https://review.whamcloud.com/37670
Subject: LU-13229 ldlm: unlock request memory leak
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7ffe06af4b0b0a2655534807dad82aceeacbf855

Comment by Gerrit Updater [ 05/Mar/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37670/
Subject: LU-13229 ldlm: unlock request memory leak
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 00ef8d08a9edc88f8b50d5761a8f96583fc39591

Comment by Peter Jones [ 05/Mar/20 ]

Landed for 2.14

Generated at Sat Feb 10 02:59:30 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.