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: rework __map_bio()

so that it follows same pattern as request-based
multipath_clone_and_map()

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

+19 -14
+19 -14
drivers/md/dm-mpath.c
··· 574 574 * Map cloned bios (bio-based multipath) 575 575 */ 576 576 577 + static void __multipath_queue_bio(struct multipath *m, struct bio *bio) 578 + { 579 + /* Queue for the daemon to resubmit */ 580 + bio_list_add(&m->queued_bios, bio); 581 + if (!test_bit(MPATHF_QUEUE_IO, &m->flags)) 582 + queue_work(kmultipathd, &m->process_queued_bios); 583 + } 584 + 577 585 static void multipath_queue_bio(struct multipath *m, struct bio *bio) 578 586 { 579 587 unsigned long flags; 580 588 581 - /* Queue for the daemon to resubmit */ 582 589 spin_lock_irqsave(&m->lock, flags); 583 - bio_list_add(&m->queued_bios, bio); 584 - if (!test_bit(MPATHF_QUEUE_IO, &m->flags)) 585 - queue_work(kmultipathd, &m->process_queued_bios); 590 + __multipath_queue_bio(m, bio); 586 591 spin_unlock_irqrestore(&m->lock, flags); 587 592 } 588 593 ··· 595 590 { 596 591 struct pgpath *pgpath; 597 592 unsigned long flags; 598 - bool queue_io; 599 593 600 594 /* Do we need to select a new pgpath? */ 601 595 pgpath = READ_ONCE(m->current_pgpath); 602 596 if (!pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags)) 603 597 pgpath = choose_pgpath(m, bio->bi_iter.bi_size); 604 598 605 - /* MPATHF_QUEUE_IO might have been cleared by choose_pgpath. */ 606 - queue_io = test_bit(MPATHF_QUEUE_IO, &m->flags); 599 + if (!pgpath) { 600 + spin_lock_irqsave(&m->lock, flags); 601 + if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) { 602 + __multipath_queue_bio(m, bio); 603 + pgpath = ERR_PTR(-EAGAIN); 604 + } 605 + spin_unlock_irqrestore(&m->lock, flags); 607 606 608 - if ((pgpath && queue_io) || 609 - (!pgpath && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))) { 607 + } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) || 608 + test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) { 610 609 multipath_queue_bio(m, bio); 611 - 612 - /* PG_INIT_REQUIRED cannot be set without QUEUE_IO */ 613 - if (queue_io || test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) 614 - pg_init_all_paths(m); 615 - 610 + pg_init_all_paths(m); 616 611 return ERR_PTR(-EAGAIN); 617 612 } 618 613