mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
eba776a4d9
commit
17383c7b81
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user