]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit165ff3b64e85ef7ed8fd703b5d6da1e5dc5b2c2c
tree28a1ca61c1a20f1314b0048145a4c2752f9219da
parent1b83f6305f6aae9e9c3a3080068c99ddfbf74e35
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