From: Alexander Aring Date: Mon, 15 Apr 2024 18:39:35 +0000 (-0400) Subject: dlm: increment ls_count for dlm_scand X-Git-Tag: v6.10-rc1~162^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=700b04808fad2eac24abf050f234f059199fa3fe;p=thirdparty%2Fkernel%2Flinux.git dlm: increment ls_count for dlm_scand Increment the ls_count value while dlm_scand is processing a lockspace so that release_lockspace()/remove_lockspace() will wait for dlm_scand to finish. Signed-off-by: Alexander Aring Signed-off-by: David Teigland --- diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index c3681a50decbb..731c48371a272 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -255,6 +255,7 @@ static struct dlm_ls *find_ls_to_scan(void) list_for_each_entry(ls, &lslist, ls_list) { if (time_after_eq(jiffies, ls->ls_scan_time + dlm_config.ci_scan_secs * HZ)) { + atomic_inc(&ls->ls_count); spin_unlock_bh(&lslist_lock); return ls; } @@ -277,6 +278,8 @@ static int dlm_scand(void *data) } else { ls->ls_scan_time += HZ; } + + dlm_put_lockspace(ls); continue; } schedule_timeout_interruptible(dlm_config.ci_scan_secs * HZ);