]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dlm: increment ls_count for dlm_scand
authorAlexander Aring <aahringo@redhat.com>
Mon, 15 Apr 2024 18:39:35 +0000 (14:39 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 16 Apr 2024 18:42:45 +0000 (13:42 -0500)
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 <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lockspace.c

index c3681a50decbb47aa3164a118a0c3d53d752ae40..731c48371a272c0053b5a0d54af5a98b151dee14 100644 (file)
@@ -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);