nvme: send a rediscover uevent when a persistent discovery controller reconnects
authorSagi Grimberg <sagi@grimberg.me>
Thu, 22 Sep 2022 08:15:37 +0000 (11:15 +0300)
committerChristoph Hellwig <hch@lst.de>
Tue, 27 Sep 2022 07:22:07 +0000 (09:22 +0200)
commitf46ef9e87c9e8941b7acee45611c7c6a322592bb
tree28a1ca61c1a20f1314b0048145a4c2752f9219da
parentbf093d971695f30e312d2d0567c5feecfbcef450
nvme: send a rediscover uevent when a persistent discovery controller reconnects

When a discovery controller is disconnected, no AENs will arrive to
notify the host about discovery log change events.

In order to solve this, send a uevent notification when a
persistent discovery controller reconnects. We add a new ctrl
flag NVME_CTRL_STARTED_ONCE that will be set on the first
start, and consecutive calls will find it set, and send the
event to userspace if the controller is a discovery controller.

Upon the event reception, userspace will re-read the discovery
log page and will act upon changes as it sees fit.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h