Skip to content

Commit eacd1ce

Browse files
author
Alexander Aring
committed
dlm: fix lkb timeout scanning lookup
JIRA: https://issues.redhat.com/browse/RHEL-82137 Upstream Status: RHEL9 only 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. Cc: stable@vger.kernel.org Reported-by: Marc Smith <msmith626@gmail.com> Fixes: dc1acd5 ("dlm: replace usage of found with dedicated list iterator variable") Signed-off-by: Alexander Aring <aahringo@redhat.com>
1 parent d143c3a commit eacd1ce

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)