dlm: fix lkb timeout scanning lookup
Subsystems (2)
Alexander Aring
maintainerPATCH 1/1 dlm: fix lkb timeout scanning lookup
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 dc1acd5c9469 ("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.
--- fs/dlm/lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dlm/lock.c +1 -1
@@ -1919,7 +1919,7 @@ void dlm_scan_timeout(struct dlm_ls *ls) }mutex_unlock (&ls->ls_timeout_mutex); -if (!lkb) +if (!do_cancel && !do_warn)break ; r = lkb->lkb_resource;
Signature · 1 line
2.43.0