Commit 73265f3f authored by Mike Snitzer's avatar Mike Snitzer

dm mpath: push locking down to must_push_back_rq()

Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent a271a89c
...@@ -472,7 +472,14 @@ static bool __must_push_back(struct multipath *m) ...@@ -472,7 +472,14 @@ static bool __must_push_back(struct multipath *m)
static bool must_push_back_rq(struct multipath *m) static bool must_push_back_rq(struct multipath *m)
{ {
return test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m); unsigned long flags;
bool ret;
spin_lock_irqsave(&m->lock, flags);
ret = (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m));
spin_unlock_irqrestore(&m->lock, flags);
return ret;
} }
/* /*
...@@ -1621,17 +1628,13 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone, ...@@ -1621,17 +1628,13 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
if (pgpath) if (pgpath)
fail_path(pgpath); fail_path(pgpath);
if (!atomic_read(&m->nr_valid_paths)) { if (!atomic_read(&m->nr_valid_paths) &&
unsigned long flags; !must_push_back_rq(m)) {
spin_lock_irqsave(&m->lock, flags);
if (!must_push_back_rq(m)) {
if (error == BLK_STS_IOERR) if (error == BLK_STS_IOERR)
dm_report_EIO(m); dm_report_EIO(m);
/* complete with the original error */ /* complete with the original error */
r = DM_ENDIO_DONE; r = DM_ENDIO_DONE;
} }
spin_unlock_irqrestore(&m->lock, flags);
}
} }
if (pgpath) { if (pgpath) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment