From aecafb57d5b60ea430ce9ef13783eb74ad4f6936 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 7 Jun 2018 12:08:42 -0500 Subject: [PATCH] LU-11075 ldlm: correct logic in ldlm_prepare_lru_list() In ldlm_prepare_lru_list() fix an (x != a || x != b) type error and correct a use after free. Signed-off-by: John L. Hammond Change-Id: I4e34e531260295805c4461e7d8d98675400f1148 Reviewed-on: https://review.whamcloud.com/32660 Tested-by: Jenkins Reviewed-by: Mike Pershin Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/ldlm/ldlm_request.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 6ce7226..fcb2b4a 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1886,7 +1886,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, /* No locks which got blocking requests. */ LASSERT(!ldlm_is_bl_ast(lock)); - if (!ldlm_is_canceling(lock) || + if (!ldlm_is_canceling(lock) && !ldlm_is_converting(lock)) break; @@ -1927,7 +1927,6 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, if (result == LDLM_POLICY_SKIP_LOCK) { lu_ref_del(&lock->l_reference, __func__, current); - LDLM_LOCK_RELEASE(lock); if (no_wait) { spin_lock(&ns->ns_lock); if (!list_empty(&lock->l_lru) && @@ -1935,6 +1934,8 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, ns->ns_last_pos = &lock->l_lru; spin_unlock(&ns->ns_lock); } + + LDLM_LOCK_RELEASE(lock); continue; } -- 1.8.3.1