[PATCH 5/6] nvme-auth: set DNR bit on non-retryable errors

Christoph Hellwig hch at lst.de
Wed Nov 2 01:02:20 PDT 2022


On Wed, Nov 02, 2022 at 08:52:23AM +0100, Hannes Reinecke wrote:
> diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
> index b4af8661c988..6ca0c2bb06c0 100644
> --- a/drivers/nvme/host/auth.c
> +++ b/drivers/nvme/host/auth.c
> @@ -151,7 +151,7 @@ static int nvme_auth_process_dhchap_challenge(struct nvme_ctrl *ctrl,
>  
>  	if (chap->buf_size < size) {
>  		chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;
> -		return NVME_SC_INVALID_FIELD;
> +		return NVME_SC_DNR | NVME_SC_INVALID_FIELD;

Any use of NVME_SC_ for error purely in host software are bogus.  This
should be using Linux error codes.



More information about the Linux-nvme mailing list