Skip to content

Commit d724952

Browse files
committed
tree: always set the host key
The current logic will not set the host secret to the controller when the sysfs value and the value from the host object are identically. Setting the secret from the host object to the controller is not what this function is supposed to do. It should read the value from the sysfs. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent cd384b4 commit d724952

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/nvme/tree.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,9 +1984,7 @@ static void nvme_read_sysfs_dhchap(nvme_root_t r, nvme_ctrl_t c)
19841984
char *host_key, *ctrl_key;
19851985

19861986
host_key = nvme_get_ctrl_attr(c, "dhchap_secret");
1987-
if (host_key && c->s && c->s->h && c->s->h->dhchap_key &&
1988-
(!strcmp(c->s->h->dhchap_key, host_key) ||
1989-
!strcmp("none", host_key))) {
1987+
if (host_key && !strcmp(host_key, "none")) {
19901988
free(host_key);
19911989
host_key = NULL;
19921990
}

0 commit comments

Comments
 (0)