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: Jim Harris <james.r.harris@intel.com>
Change-Id: I8f476a47e9fd07bf652fd64f3b1c17d650374167
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8506
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Jim Harris 2021-06-24 15:31:09 +00:00
parent 7232c450f9
commit 10c7d133be

View File

@ -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;
}