linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: send uevent once a multipath namespace is operational again
@ 2021-02-26  8:05 Hannes Reinecke
  2021-02-26  9:17 ` Daniel Wagner
  2021-03-03  8:39 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Hannes Reinecke @ 2021-02-26  8:05 UTC (permalink / raw)
  To: Keith Busch; +Cc: Hannes Reinecke, Sagi Grimberg, linux-nvme, Christoph Hellwig

In an all paths down scenario I/O will be requeued or aborted, and no
further I/O will be ongoing on this namespace.
This leaves the upper layers unable to determine if the namespace
becomes operational again eg. after a successful controller reset.
With this patch a 'change' uevent will be sent per multipathed namespace
once the underlying controller moved to LIVE and started I/O processing
by calling nvme_kick_requeue_lists().

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/nvme/host/multipath.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 7d38f9272490..844d952bd86f 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -97,8 +97,12 @@ void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)
 
 	down_read(&ctrl->namespaces_rwsem);
 	list_for_each_entry(ns, &ctrl->namespaces, list) {
-		if (ns->head->disk)
-			kblockd_schedule_work(&ns->head->requeue_work);
+		if (!ns->head->disk)
+			continue;
+		kblockd_schedule_work(&ns->head->requeue_work);
+		if (ctrl->state == NVME_CTRL_LIVE)
+			kobject_uevent(&disk_to_dev(ns->head->disk)->kobj,
+				       KOBJ_CHANGE);
 	}
 	up_read(&ctrl->namespaces_rwsem);
 }
-- 
2.26.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: send uevent once a multipath namespace is operational again
  2021-02-26  8:05 [PATCH] nvme: send uevent once a multipath namespace is operational again Hannes Reinecke
@ 2021-02-26  9:17 ` Daniel Wagner
  2021-03-03  8:39 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2021-02-26  9:17 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: linux-nvme, Sagi Grimberg, Keith Busch, Christoph Hellwig

On Fri, Feb 26, 2021 at 09:05:38AM +0100, Hannes Reinecke wrote:
> In an all paths down scenario I/O will be requeued or aborted, and no
> further I/O will be ongoing on this namespace.
> This leaves the upper layers unable to determine if the namespace
> becomes operational again eg. after a successful controller reset.
> With this patch a 'change' uevent will be sent per multipathed namespace
> once the underlying controller moved to LIVE and started I/O processing
> by calling nvme_kick_requeue_lists().
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>

Reviewed-by: Daniel Wagner <dwagner@suse.de>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: send uevent once a multipath namespace is operational again
  2021-02-26  8:05 [PATCH] nvme: send uevent once a multipath namespace is operational again Hannes Reinecke
  2021-02-26  9:17 ` Daniel Wagner
@ 2021-03-03  8:39 ` Christoph Hellwig
  2021-03-03  9:11   ` Hannes Reinecke
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2021-03-03  8:39 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Keith Busch, Sagi Grimberg, Christoph Hellwig, linux-nvme

On Fri, Feb 26, 2021 at 09:05:38AM +0100, Hannes Reinecke wrote:
> In an all paths down scenario I/O will be requeued or aborted, and no
> further I/O will be ongoing on this namespace.
> This leaves the upper layers unable to determine if the namespace
> becomes operational again eg. after a successful controller reset.
> With this patch a 'change' uevent will be sent per multipathed namespace
> once the underlying controller moved to LIVE and started I/O processing
> by calling nvme_kick_requeue_lists().

This should use disk_uevent().

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: send uevent once a multipath namespace is operational again
  2021-03-03  8:39 ` Christoph Hellwig
@ 2021-03-03  9:11   ` Hannes Reinecke
  0 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2021-03-03  9:11 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme

On 3/3/21 9:39 AM, Christoph Hellwig wrote:
> On Fri, Feb 26, 2021 at 09:05:38AM +0100, Hannes Reinecke wrote:
>> In an all paths down scenario I/O will be requeued or aborted, and no
>> further I/O will be ongoing on this namespace.
>> This leaves the upper layers unable to determine if the namespace
>> becomes operational again eg. after a successful controller reset.
>> With this patch a 'change' uevent will be sent per multipathed namespace
>> once the underlying controller moved to LIVE and started I/O processing
>> by calling nvme_kick_requeue_lists().
> 
> This should use disk_uevent().
> 
Right. Will be updating the patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-03 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26  8:05 [PATCH] nvme: send uevent once a multipath namespace is operational again Hannes Reinecke
2021-02-26  9:17 ` Daniel Wagner
2021-03-03  8:39 ` Christoph Hellwig
2021-03-03  9:11   ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).