lock convert can re-grant lock if it loses some bits. this
procedure can race with the import's invalidation. thus
lock can become invalid (l_granted_mode=LCK_MINMODE):
LustreError: 8637:0:(ldlm_lock.c:1095:ldlm_grant_lock_with_skiplist())
ASSERTION( ldlm_is_granted(lock) )
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I7bb20d62948224647d7632f2822fba44d39a7713
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53051
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>
if (rc)
GOTO(full_cancel, rc);
+ /*
+ * check that the lock is still actual as it could get
+ * invalidated by an eviction being unproteced few
+ * lines above.
+ */
+ if (ldlm_is_failed(lock))
+ GOTO(full_cancel, rc = -EINVAL);
+
/* Finally clear these bits in lock ibits */
ldlm_inodebits_drop(lock, drop_bits);