From ac03d9206f2db2a1110a5c8b1212d16ccb2768ff Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 13 Nov 2019 11:05:15 -0700 Subject: [PATCH] nvmf: Use correct error code on bad reservation report command The NVMe-oF target requires 128-bit identifiers for reservations, so the extended report format must be used. If the user issues a reservation report command without the extended format bit set, the specification says to fail it with the HOSTID_INCONSISTENT_FORMAT error code. Change-Id: I2382af4f69167322d8e2c3f06cf8d9042830a70c Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474131 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Alexey Marchuk Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- lib/nvmf/subsystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvmf/subsystem.c b/lib/nvmf/subsystem.c index dc34df3a3..061c66c4c 100644 --- a/lib/nvmf/subsystem.c +++ b/lib/nvmf/subsystem.c @@ -2341,7 +2341,7 @@ nvmf_ns_reservation_report(struct spdk_nvmf_ns *ns, if ((cmd->cdw11 & 0x00000001u) == 0) { SPDK_ERRLOG("NVMeoF uses extended controller data structure, " "please set EDS bit in cdw11 and try again\n"); - status = SPDK_NVME_SC_INVALID_FIELD; + status = SPDK_NVME_SC_HOSTID_INCONSISTENT_FORMAT; goto exit; }