Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm mpath: push locking down to must_push_back_rq()

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

+14 -11
+14 -11
drivers/md/dm-mpath.c
··· 472 472 473 473 static bool must_push_back_rq(struct multipath *m) 474 474 { 475 - return test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m); 475 + unsigned long flags; 476 + bool ret; 477 + 478 + spin_lock_irqsave(&m->lock, flags); 479 + ret = (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags) || __must_push_back(m)); 480 + spin_unlock_irqrestore(&m->lock, flags); 481 + 482 + return ret; 476 483 } 477 484 478 485 /* ··· 1628 1621 if (pgpath) 1629 1622 fail_path(pgpath); 1630 1623 1631 - if (!atomic_read(&m->nr_valid_paths)) { 1632 - unsigned long flags; 1633 - spin_lock_irqsave(&m->lock, flags); 1634 - if (!must_push_back_rq(m)) { 1635 - if (error == BLK_STS_IOERR) 1636 - dm_report_EIO(m); 1637 - /* complete with the original error */ 1638 - r = DM_ENDIO_DONE; 1639 - } 1640 - spin_unlock_irqrestore(&m->lock, flags); 1624 + if (!atomic_read(&m->nr_valid_paths) && 1625 + !must_push_back_rq(m)) { 1626 + if (error == BLK_STS_IOERR) 1627 + dm_report_EIO(m); 1628 + /* complete with the original error */ 1629 + r = DM_ENDIO_DONE; 1641 1630 } 1642 1631 } 1643 1632