Commit 10c7d133 authored by Jim Harris's avatar Jim Harris
Browse files

nvmf: print debug response value after prop size check



When the property is 8 bytes but the host only requested
4, we need to mask and only return the bytes requested
by the host.  Wait to do the DEBUGLOG until after
that has happened.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I8f476a47e9fd07bf652fd64f3b1c17d650374167
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8506


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatar <dongx.yi@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 7232c450
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1194,8 +1194,6 @@ nvmf_property_get(struct spdk_nvmf_request *req)

	response->value.u64 = prop->get_cb(ctrlr);

	SPDK_DEBUGLOG(nvmf, "response value: 0x%" PRIx64 "\n", response->value.u64);

	if (size != prop->size) {
		/* The size must be 4 and the prop->size is 8. Figure out which part of the property to read. */
		assert(size == 4);
@@ -1210,6 +1208,8 @@ nvmf_property_get(struct spdk_nvmf_request *req)
		}
	}

	SPDK_DEBUGLOG(nvmf, "response value: 0x%" PRIx64 "\n", response->value.u64);

	return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
}