[lustre-devel] [PATCH 24/49] lustre: ldlm: not freed req on enqueue

James Simmons jsimmons at infradead.org
Wed Apr 14 21:02:16 PDT 2021

From: Vitaly Fertman <c17818 at cray.com>

ldlm_cli_enqueue may allocate a req but failed to allocate a req
slot and returns an errors without freeing the req.

Fixes: b16c40c836 ("lustre: ldlm: FLOCK request can be processed twice")
HPE-bug-id: LUS-9337
WC-bug-id: https://jira.whamcloud.com/browse/LU-12828
Lustre-commit: ce9c1c11593814da ("LU-12828 ldlm: not freed req on enqueue")
Signed-off-by: Vitaly Fertman <c17818 at cray.com>
Reviewed-on: https://es-gerrit.dev.cray.com/158433
Reviewed-by: Alexander Boyko <c17825 at cray.com>
Reviewed-by: Andriy Skulysh <c17819 at cray.com>
Reviewed-on: https://review.whamcloud.com/41818
Reviewed-by: Alexander Boyko <alexander.boyko at hpe.com>
Reviewed-by: Andriy Skulysh <askulysh at gmail.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
 fs/lustre/ldlm/ldlm_request.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/lustre/ldlm/ldlm_request.c b/fs/lustre/ldlm/ldlm_request.c
index 1c2ecf2..d8ca744 100644
--- a/fs/lustre/ldlm/ldlm_request.c
+++ b/fs/lustre/ldlm/ldlm_request.c
@@ -840,6 +840,8 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
 			failed_lock_cleanup(ns, lock, einfo->ei_mode);
+			if (!req_passed_in)
+				ptlrpc_req_finished(req);
 			goto out;

More information about the lustre-devel mailing list