Skip to content

Commit 8860546

Browse files
author
CKI KWF Bot
committed
Merge: dlm: fix lkb timeout scanning lookup
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7394 JIRA: https://issues.redhat.com/browse/RHEL-82137 If a lkb is timed out when dlm_scan_timeout() kicks in and removes a timed out lkb from ls->ls_timeout list the next iteration can end in timeout the same lkb again that shouldn't happen. Since commit dc1acd5 ("dlm: replace usage of found with dedicated list iterator variable") we don't set the lkb variable before the inner lookup loop to NULL. The outer loop will not stop and checks if there was a successful lookup with the lkb pointer of the last iteration that wasn't set to NULL. To stop this behavior we use the old condition "!do_cancel && !do_warn" which signals if there was a successful lookup and the lkb variable should be set with the lkb that was looked up to be timed out. If the condition is false there is no timed out lkb in ls->ls_timeout and the outer loop stops. Signed-off-by: Alexander Aring <aahringo@redhat.com> Approved-by: Andreas Gruenbacher <agruenba@redhat.com> Approved-by: David Teigland <teigland@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 65d87c6 + eacd1ce commit 8860546

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/dlm/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ void dlm_scan_timeout(struct dlm_ls *ls)
18881888
}
18891889
mutex_unlock(&ls->ls_timeout_mutex);
18901890

1891-
if (!lkb)
1891+
if (!do_cancel && !do_warn)
18921892
break;
18931893

18941894
r = lkb->lkb_resource;

0 commit comments

Comments
 (0)