Skip to contentSkip to conversation

nvme: reset disk to the mpath node also when requeuing

PATCH In review Daniel Wagner 1 participant 2 messages Jun 2, 2021 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: reset disk to the mpath node also when requeuing

Commit ce86dad222e9 ("nvme-multipath: reset bdev to ns head when failover") moved the reset code where the bio is added to the requeue_list for the failover path. But it left the original bio_set_dev() in nvme_requeue_work().

Let's move the bio_set_dev() where we add the bio to the requeue_list and avoid the double setting in case of the failover path. And this makes the code more consistent.

---
 drivers/nvme/host/multipath.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/nvme/host/multipath.c +1 -5
index 127a17b4c13d..df07fc2ad7bc 100644
@@ -324,6 +324,7 @@ static blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
 		dev_warn_ratelimited(dev, "no usable path - requeuing I/O\n");
 
 		spin_lock_irq(&head->requeue_lock);
+		bio_set_dev(bio, head->disk->part0);
 		bio_list_add(&head->requeue_list, bio);
 		spin_unlock_irq(&head->requeue_lock);
 	} else {
@@ -435,11 +436,6 @@ static void nvme_requeue_work(struct work_struct *work)
 		next = bio->bi_next;
 		bio->bi_next = NULL;
 
-		/*
-		 * Reset disk to the mpath node and resubmit to select a new
-		 * path.
-		 */
-		bio_set_dev(bio, head->disk->part0);
 		submit_bio_noacct(bio);
 	}
 }
Signature · 7 lines
2.29.2


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#1 lore raw

drivers/nvme/host/multipath.c static blk_qc_t nvme_ns_head_submit_bio(struct bio *bio) · line 327

Quoted 2 lines · Daniel Wagner
drivers/nvme/host/multipath.c +1 -0
 		spin_lock_irq(&head->requeue_lock);
+		bio_set_dev(bio, head->disk->part0);

Obviously, this needs to be done for all bios. Let me send an updated version.x

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme