Whamcloud - gitweb
LU-17415 ldlm: lock conversion to skip cancelled locks 45/53645/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 11 Jan 2024 05:28:40 +0000 (08:28 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:13:41 +0000 (07:13 +0000)
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 <bzzz@whamcloud.com>
Change-Id: If212931d8fa6a2d8f56c44714de830d5fb4a9a6b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53645
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_inodebits.c

index af4e744..a10aa17 100644 (file)
@@ -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);