Skip to content

Commit 7527684

Browse files
shifteekeithbusch
authored andcommitted
nvme-auth: auth success1 msg always includes resp
In cases where RVALID is false, the response is still transmitted, but is cleared to zero. Relevant extract from the spec: Response R2, if valid (i.e., if the RVALID field is set to 01h), cleared to 0h otherwise Signed-off-by: Mark O'Donovan <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 1147dd0 commit 7527684

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

drivers/nvme/host/auth.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
339339
struct nvme_dhchap_queue_context *chap)
340340
{
341341
struct nvmf_auth_dhchap_success1_data *data = chap->buf;
342-
size_t size = sizeof(*data);
343-
344-
if (chap->s2)
345-
size += chap->hash_len;
342+
size_t size = sizeof(*data) + chap->hash_len;
346343

347344
if (size > CHAP_BUF_SIZE) {
348345
chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;

include/linux/nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ struct nvmf_auth_dhchap_success1_data {
17321732
__u8 rsvd2;
17331733
__u8 rvalid;
17341734
__u8 rsvd3[7];
1735-
/* 'hl' bytes of response value if 'rvalid' is set */
1735+
/* 'hl' bytes of response value */
17361736
__u8 rval[];
17371737
};
17381738

0 commit comments

Comments
 (0)