Skip to content

Commit 700b048

Browse files
Alexander Aringteigland
authored andcommitted
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 <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 92d59ad commit 700b048

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/dlm/lockspace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ static struct dlm_ls *find_ls_to_scan(void)
255255
list_for_each_entry(ls, &lslist, ls_list) {
256256
if (time_after_eq(jiffies, ls->ls_scan_time +
257257
dlm_config.ci_scan_secs * HZ)) {
258+
atomic_inc(&ls->ls_count);
258259
spin_unlock_bh(&lslist_lock);
259260
return ls;
260261
}
@@ -277,6 +278,8 @@ static int dlm_scand(void *data)
277278
} else {
278279
ls->ls_scan_time += HZ;
279280
}
281+
282+
dlm_put_lockspace(ls);
280283
continue;
281284
}
282285
schedule_timeout_interruptible(dlm_config.ci_scan_secs * HZ);

0 commit comments

Comments
 (0)