Skip to content

Commit e8a420e

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme-auth: no need to reset chap contexts on re-authentication
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 <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 96df318 commit e8a420e

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

drivers/nvme/host/auth.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -901,19 +901,6 @@ int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
901901
}
902902
EXPORT_SYMBOL_GPL(nvme_auth_wait);
903903

904-
void nvme_auth_reset(struct nvme_ctrl *ctrl)
905-
{
906-
struct nvme_dhchap_queue_context *chap;
907-
908-
mutex_lock(&ctrl->dhchap_auth_mutex);
909-
list_for_each_entry(chap, &ctrl->dhchap_auth_list, entry) {
910-
mutex_unlock(&ctrl->dhchap_auth_mutex);
911-
flush_work(&chap->auth_work);
912-
nvme_auth_reset_dhchap(chap);
913-
}
914-
mutex_unlock(&ctrl->dhchap_auth_mutex);
915-
}
916-
917904
static void nvme_ctrl_auth_work(struct work_struct *work)
918905
{
919906
struct nvme_ctrl *ctrl =

drivers/nvme/host/core.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3787,8 +3787,6 @@ static ssize_t nvme_ctrl_dhchap_secret_store(struct device *dev,
37873787
host_key = ctrl->host_key;
37883788
ctrl->host_key = key;
37893789
nvme_auth_free_key(host_key);
3790-
/* Key has changed; re-authentication with new key */
3791-
nvme_auth_reset(ctrl);
37923790
}
37933791
/* Start re-authentication */
37943792
dev_info(ctrl->device, "re-authenticating controller\n");
@@ -3841,8 +3839,6 @@ static ssize_t nvme_ctrl_dhchap_ctrl_secret_store(struct device *dev,
38413839
ctrl_key = ctrl->ctrl_key;
38423840
ctrl->ctrl_key = key;
38433841
nvme_auth_free_key(ctrl_key);
3844-
/* Key has changed; re-authentication with new key */
3845-
nvme_auth_reset(ctrl);
38463842
}
38473843
/* Start re-authentication */
38483844
dev_info(ctrl->device, "re-authenticating controller\n");

drivers/nvme/host/nvme.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,6 @@ int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl);
10241024
void nvme_auth_stop(struct nvme_ctrl *ctrl);
10251025
int nvme_auth_negotiate(struct nvme_ctrl *ctrl, int qid);
10261026
int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid);
1027-
void nvme_auth_reset(struct nvme_ctrl *ctrl);
10281027
void nvme_auth_free(struct nvme_ctrl *ctrl);
10291028
#else
10301029
static inline int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl)

0 commit comments

Comments
 (0)