From: Alex Zhuravlev Date: Thu, 11 Jan 2024 05:28:40 +0000 (+0300) Subject: LU-17415 ldlm: lock conversion to skip cancelled locks X-Git-Tag: 2.15.62~191 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1714b65e47e87c6f493810bd14a4ed2922965011;p=fs%2Flustre-release.git LU-17415 ldlm: lock conversion to skip cancelled locks ldlm_cli_inodebits_convert() should re-check the lock so it's not being cancelled to skip such locks and avoid an assertion: LustreError: 15208:0:(ldlm_lock.c:1095:ldlm_grant_lock_with_skiplist()) ASSERTION( ldlm_is_granted(lock) ) failed: Signed-off-by: Alex Zhuravlev Change-Id: If212931d8fa6a2d8f56c44714de830d5fb4a9a6b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53645 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_inodebits.c b/lustre/ldlm/ldlm_inodebits.c index af4e744..a10aa17 100644 --- a/lustre/ldlm/ldlm_inodebits.c +++ b/lustre/ldlm/ldlm_inodebits.c @@ -584,15 +584,15 @@ int ldlm_cli_inodebits_convert(struct ldlm_lock *lock, if (ldlm_is_failed(lock)) GOTO(full_cancel, rc = -EINVAL); - /* Finally clear these bits in lock ibits */ - ldlm_inodebits_drop(lock, drop_bits); - /* Being locked again check if lock was canceled, it is important * to do and don't drop cbpending below */ if (ldlm_is_canceling(lock)) GOTO(full_cancel, rc = -EINVAL); + /* Finally clear these bits in lock ibits */ + ldlm_inodebits_drop(lock, drop_bits); + /* also check again if more bits to be cancelled appeared */ if (drop_bits != lock->l_policy_data.l_inodebits.cancel_bits) GOTO(clear_converting, rc = -EAGAIN);