Skip to contentSkip to conversation

linux-next: manual merge of the block tree with Linus' tree

PATCH Stephen Rothwell 2 participants 3 messages Dec 31, 2015 – Jan 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

drivers/nvme/host/pci.c

between commit:

b5875222de2f ("NVMe: IO ending fixes on surprise removal")

from Linus' tree and commit:

5bae7f73d378 ("nvme: move namespace scanning to common code")

from the block tree.

I fixed it up (the code was moved - I added the fix patch below) and can carry the fix as necessary (no action is required).

However, there was another part to the former patch that I could not quite figure out how to reproduce - the fix to nvme_dev_remove().

From: Stephen Rothwell <[email protected]>
Date: Thu, 31 Dec 2015 14:21:38 +1100
Subject: [PATCH] nvme: merge fix up for ns code movement

---
 drivers/nvme/host/core.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +10 -1
index 1437ff36e91c..1375a83593b5 100644
@@ -1118,8 +1118,17 @@ static void nvme_ns_remove(struct nvme_ns *ns)
 	bool kill = nvme_io_incapable(ns->ctrl) &&
 			!blk_queue_dying(ns->queue);
 
-	if (kill)
+	if (kill) {
 		blk_set_queue_dying(ns->queue);
+
+		/*
+		 * The controller was shutdown first if we got here through
+		 * device removal. The shutdown may requeue outstanding
+		 * requests. These need to be aborted immediately so
+		 * del_gendisk doesn't block indefinitely for their completion.
+		 */
+		blk_mq_abort_requeue_list(ns->queue);
+	}
 	if (ns->disk->flags & GENHD_FL_UP) {
 		if (blk_get_integrity(ns->disk))
 			blk_integrity_unregister(ns->disk);
Signature · 5 lines
2.6.4

-- 
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw

Hi Jens,

Quoted 55 lines · On Thu, 31 Dec 2015 14:34:57 +1100 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the block tree got a conflict in:

drivers/nvme/host/pci.c

between commit:

b5875222de2f ("NVMe: IO ending fixes on surprise removal")

from Linus' tree and commit:

5bae7f73d378 ("nvme: move namespace scanning to common code")

from the block tree.

I fixed it up (the code was moved - I added the fix patch below) and can carry the fix as necessary (no action is required).

However, there was another part to the former patch that I could not quite figure out how to reproduce - the fix to nvme_dev_remove().

From: Stephen Rothwell <[email protected]>
Date: Thu, 31 Dec 2015 14:21:38 +1100
Subject: [PATCH] nvme: merge fix up for ns code movement

---
 drivers/nvme/host/core.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +10 -1
index 1437ff36e91c..1375a83593b5 100644
@@ -1118,8 +1118,17 @@ static void nvme_ns_remove(struct nvme_ns *ns)
 	bool kill = nvme_io_incapable(ns->ctrl) &&
 			!blk_queue_dying(ns->queue);
 
-	if (kill)
+	if (kill) {
 		blk_set_queue_dying(ns->queue);
+
+		/*
+		 * The controller was shutdown first if we got here through
+		 * device removal. The shutdown may requeue outstanding
+		 * requests. These need to be aborted immediately so
+		 * del_gendisk doesn't block indefinitely for their completion.
+		 */
+		blk_mq_abort_requeue_list(ns->queue);
+	}
 	if (ns->disk->flags & GENHD_FL_UP) {
 		if (blk_get_integrity(ns->disk))
 			blk_integrity_unregister(ns->disk);
Signature · 1 line
2.6.4

So, I have been applying the above merge fix patch since Dec 31 and now wonder if Linus needs to be told about it. Also noone every replied about the nvme_dev_remove() part.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
maintainer
#2 lore raw
Quoted 54 lines · Stephen Rothwell

Hi Jens,

Quoted 51 lines · On Thu, 31 Dec 2015 14:34:57 +1100 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the block tree got a conflict in:

drivers/nvme/host/pci.c

between commit:

b5875222de2f ("NVMe: IO ending fixes on surprise removal")

from Linus' tree and commit:

5bae7f73d378 ("nvme: move namespace scanning to common code")

from the block tree.

I fixed it up (the code was moved - I added the fix patch below) and can carry the fix as necessary (no action is required).

However, there was another part to the former patch that I could not quite figure out how to reproduce - the fix to nvme_dev_remove().

From: Stephen Rothwell <[email protected]>
Date: Thu, 31 Dec 2015 14:21:38 +1100
Subject: [PATCH] nvme: merge fix up for ns code movement

---
  drivers/nvme/host/core.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +10 -1
index 1437ff36e91c..1375a83593b5 100644
@@ -1118,8 +1118,17 @@ static void nvme_ns_remove(struct nvme_ns *ns)
  	bool kill = nvme_io_incapable(ns->ctrl) &&
  			!blk_queue_dying(ns->queue);
 
-	if (kill)
+	if (kill) {
  		blk_set_queue_dying(ns->queue);
+
+		/*
+		 * The controller was shutdown first if we got here through
+		 * device removal. The shutdown may requeue outstanding
+		 * requests. These need to be aborted immediately so
+		 * del_gendisk doesn't block indefinitely for their completion.
+		 */
+		blk_mq_abort_requeue_list(ns->queue);
+	}
  	if (ns->disk->flags & GENHD_FL_UP) {
Quoted 8 lines
Quoted 4 lines
drivers/nvme/host/core.c +0 -1
  		if (blk_get_integrity(ns->disk))
  			blk_integrity_unregister(ns->disk);
--

2.6.4

So, I have been applying the above merge fix patch since Dec 31 and now wonder if Linus needs to be told about it. Also noone every replied about the nvme_dev_remove() part.

Linus is usually pretty damn good at figuring out, and seems to have fun doing it. So I usually just defer to acking a merge resolution, but even that is rarely needed. It was more of a mess this time around between mainline and the nvme branch than I would have liked though, but mostly due to timing of branching.

Signature · 1 line
Jens Axboe