nvme-auth: no need to reset chap contexts on re-authentication
[ Upstream commit e8a420efb637f52c586596283d6fd96f2a7ecb5c ]
Now that the chap context is reset upon completion, this is no longer
needed. Also remove nvme_auth_reset as no callers are left.
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>
Stable-dep-of: a836ca33c5b0 ("nvme-core: fix memory leak in dhchap_secret_store")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3999c850e7
commit
0a220ef9dd
3 changed files with 0 additions and 18 deletions
|
|
@ -920,19 +920,6 @@ int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(nvme_auth_wait);
|
EXPORT_SYMBOL_GPL(nvme_auth_wait);
|
||||||
|
|
||||||
void nvme_auth_reset(struct nvme_ctrl *ctrl)
|
|
||||||
{
|
|
||||||
struct nvme_dhchap_queue_context *chap;
|
|
||||||
|
|
||||||
mutex_lock(&ctrl->dhchap_auth_mutex);
|
|
||||||
list_for_each_entry(chap, &ctrl->dhchap_auth_list, entry) {
|
|
||||||
mutex_unlock(&ctrl->dhchap_auth_mutex);
|
|
||||||
flush_work(&chap->auth_work);
|
|
||||||
nvme_auth_reset_dhchap(chap);
|
|
||||||
}
|
|
||||||
mutex_unlock(&ctrl->dhchap_auth_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void nvme_ctrl_auth_work(struct work_struct *work)
|
static void nvme_ctrl_auth_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct nvme_ctrl *ctrl =
|
struct nvme_ctrl *ctrl =
|
||||||
|
|
|
||||||
|
|
@ -3832,8 +3832,6 @@ static ssize_t nvme_ctrl_dhchap_secret_store(struct device *dev,
|
||||||
host_key = ctrl->host_key;
|
host_key = ctrl->host_key;
|
||||||
ctrl->host_key = key;
|
ctrl->host_key = key;
|
||||||
nvme_auth_free_key(host_key);
|
nvme_auth_free_key(host_key);
|
||||||
/* Key has changed; re-authentication with new key */
|
|
||||||
nvme_auth_reset(ctrl);
|
|
||||||
}
|
}
|
||||||
/* Start re-authentication */
|
/* Start re-authentication */
|
||||||
dev_info(ctrl->device, "re-authenticating controller\n");
|
dev_info(ctrl->device, "re-authenticating controller\n");
|
||||||
|
|
@ -3886,8 +3884,6 @@ static ssize_t nvme_ctrl_dhchap_ctrl_secret_store(struct device *dev,
|
||||||
ctrl_key = ctrl->ctrl_key;
|
ctrl_key = ctrl->ctrl_key;
|
||||||
ctrl->ctrl_key = key;
|
ctrl->ctrl_key = key;
|
||||||
nvme_auth_free_key(ctrl_key);
|
nvme_auth_free_key(ctrl_key);
|
||||||
/* Key has changed; re-authentication with new key */
|
|
||||||
nvme_auth_reset(ctrl);
|
|
||||||
}
|
}
|
||||||
/* Start re-authentication */
|
/* Start re-authentication */
|
||||||
dev_info(ctrl->device, "re-authenticating controller\n");
|
dev_info(ctrl->device, "re-authenticating controller\n");
|
||||||
|
|
|
||||||
|
|
@ -1032,7 +1032,6 @@ void nvme_auth_init_ctrl(struct nvme_ctrl *ctrl);
|
||||||
void nvme_auth_stop(struct nvme_ctrl *ctrl);
|
void nvme_auth_stop(struct nvme_ctrl *ctrl);
|
||||||
int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid);
|
int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid);
|
||||||
int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid);
|
int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid);
|
||||||
void nvme_auth_reset(struct nvme_ctrl *ctrl);
|
|
||||||
void nvme_auth_free(struct nvme_ctrl *ctrl);
|
void nvme_auth_free(struct nvme_ctrl *ctrl);
|
||||||
#else
|
#else
|
||||||
static inline void nvme_auth_init_ctrl(struct nvme_ctrl *ctrl) {};
|
static inline void nvme_auth_init_ctrl(struct nvme_ctrl *ctrl) {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue