dm-mpath: check values in hst_status while holding spinlock

To keep the values of pi->historical_service_time,
pi->outstanding, and pi->stale_after consistent, get them while
holding a spin_lock in hst_status(), like all other accesses do.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
This commit is contained in:
Benjamin Marzinski 2026-10-08 16:28:09 -04:00 committed by Mikulas Patocka
parent eba776a4d9
commit 17383c7b81

View File

@ -202,6 +202,7 @@ static int hst_status(struct path_selector *ps, struct dm_path *path,
{
unsigned int sz = 0;
struct path_info *pi;
unsigned long flags;
if (!path) {
struct selector *s = ps->context;
@ -212,8 +213,10 @@ static int hst_status(struct path_selector *ps, struct dm_path *path,
switch (type) {
case STATUSTYPE_INFO:
spin_lock_irqsave(&pi->lock, flags);
DMEMIT("%llu %llu %llu ", pi->historical_service_time,
pi->outstanding, pi->stale_after);
spin_unlock_irqrestore(&pi->lock, flags);
break;
case STATUSTYPE_TABLE:
DMEMIT("%u ", pi->repeat_count);