diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2022-11-13 13:24:08 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-11-16 08:36:34 +0100 |
commit | c7390f132a896ff1a3fa26ea2b0be4f9ceb9041e (patch) | |
tree | 7a9796eb0b9ae1d07822106c9c571178d7781269 /drivers/nvme | |
parent | 100b555bc204fc754108351676297805f5affa49 (diff) | |
download | linux-c7390f132a896ff1a3fa26ea2b0be4f9ceb9041e.tar.bz2 |
nvme-auth: don't re-authenticate if the controller is not LIVE
The connect sequence will re-authenticate.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/auth.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index 2f823c6b84fd..4f2c8d0567bd 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -939,6 +939,13 @@ static void nvme_ctrl_auth_work(struct work_struct *work) container_of(work, struct nvme_ctrl, dhchap_auth_work); int ret, q; + /* + * If the ctrl is no connected, bail as reconnect will handle + * authentication. + */ + if (ctrl->state != NVME_CTRL_LIVE) + return; + /* Authenticate admin queue first */ ret = nvme_auth_negotiate(ctrl, 0); if (ret) { |