Skip to contentSkip to conversation

nvme: a couple of small fixes

PATCH Applied John Garry 3 participants 6 messages Feb 5 – Feb 6 NVMe

lore
Share & tools
lore

John Garry

author
#0 lore raw

cover nvme: a couple of small fixes

This is just a couple of small fixes, based on nvme 7.0 queue.

John Garry (2):
nvme: correct comment about nvme_ns_remove()
nvme: stop setting namespace gendisk device driver data

 drivers/nvme/host/core.c      | 7 -------
 drivers/nvme/host/multipath.c | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)
Signature · 1 line
2.43.5
author
#1 lore raw

PATCH 1/2 nvme: correct comment about nvme_ns_remove()

The comment in nvme_mpath_remove_disk() references nvme_remove_ns(), which should be nvme_ns_remove().

---
 drivers/nvme/host/multipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/multipath.c +1 -1
index 174027d1cc198..bfcc5904e6a26 100644
@@ -1300,7 +1300,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)
 	mutex_lock(&head->subsys->lock);
 	/*
 	 * We are called when all paths have been removed, and at that point
-	 * head->list is expected to be empty. However, nvme_remove_ns() and
+	 * head->list is expected to be empty. However, nvme_ns_remove() and
 	 * nvme_init_ns_head() can run concurrently and so if head->delayed_
 	 * removal_secs is configured, it is possible that by the time we reach
 	 * this point, head->list may no longer be empty. Therefore, we recheck
Signature · 1 line
2.43.5
author
#3 lore raw

PATCH 2/2 nvme: stop setting namespace gendisk device driver data

In reply to John Garry

Since commit 1f4137e882c6 ("nvme: move passthrough logging attribute to head"), we stopped using the namespace to hold the passthrough logging enabled attribute. There is now nowhere now which looks up the gendisk dev driver data, so stop setting it.

Incidentally, it would have been better to set this before adding the disk.

---
 drivers/nvme/host/core.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/nvme/host/core.c +0 -7
index c12986495e712..3a2126584a236 100644
@@ -4181,13 +4181,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
 	nvme_mpath_add_disk(ns, info->anagrpid);
 	nvme_fault_inject_init(&ns->fault_inject, ns->disk->disk_name);
 
-	/*
-	 * Set ns->disk->device->driver_data to ns so we can access
-	 * ns->head->passthru_err_log_enabled in
-	 * nvme_io_passthru_err_log_enabled_[store | show]().
-	 */
-	dev_set_drvdata(disk_to_dev(ns->disk), ns);
-
 	return;
 
  out_cleanup_ns_from_list:
Signature · 1 line
2.43.5
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] nvme: stop setting namespace gendisk device driver data

Quoted 7 lines · John Garry

Since commit 1f4137e882c6 ("nvme: move passthrough logging attribute to head"), we stopped using the namespace to hold the passthrough logging enabled attribute. There is now nowhere now which looks up the gendisk dev driver data, so stop setting it.

Incidentally, it would have been better to set this before adding the disk.

I could also not find any other user of this drvdata field, so: