nvmet: return DHCHAP status codes from nvmet_setup_auth()
authorHannes Reinecke <hare@kernel.org>
Tue, 30 Apr 2024 13:19:25 +0000 (15:19 +0200)
committerKeith Busch <kbusch@kernel.org>
Wed, 1 May 2024 10:07:20 +0000 (03:07 -0700)
commit44e3c25efae8575e06f1c5d1dc40058a991e3cb2
tree03112c9ff24ad6e28cb6f29eaee452e69e8b7289
parent213cbada7b07bf66409604e0d0dcd66a6a14891a
nvmet: return DHCHAP status codes from nvmet_setup_auth()

A failure in nvmet_setup_auth() does not mean that the NVMe
authentication command failed, so we should rather return a protocol
error with a 'failure1' response than an NVMe status.

Also update the type used for dhchap_step and dhchap_status to u8 to
avoid confusions with nvme status. Furthermore, split dhchap_status and
nvme status so we don't accidentally mix these return values.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
[dwagner: - use u8 as type for dhchap_{step|status}
          - separate nvme status from dhcap_status]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/auth.c
drivers/nvme/target/fabrics-cmd-auth.c
drivers/nvme/target/fabrics-cmd.c
drivers/nvme/target/nvmet.h