numam-spdk/lib/bdev/nvme
Darek Stojaczyk 4a713238b7 nvme: fix json response on failed construct_nvme_bdev RPCs
spdk_jsonrpc_send_error_response() is documented as a
shorthand for spdk_jsonrpc_begin_result() + end result,
but we used to call it already after doing
spdk_jsonrpc_begin_result(), which makes the response
completely invalid.

Fix it by deferring the initial spdk_jsonrpc_begin_result()
until after we did our error checking. While here, remove
the NULL checks from that function. After recent jsonrpc
changes it can never return NULL.

Change-Id: Ibb69803d4e6ce6516817673eec6626dcfc4f1abf
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464174
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-09 16:35:00 +00:00
..
bdev_ftl_rpc.c bdev/ftl: Add defrag parameters to construct_ftl_bdev rpc 2019-07-24 18:21:07 +00:00
bdev_ftl.c bdev/ftl: Add defrag parameters to construct_ftl_bdev rpc 2019-07-24 18:21:07 +00:00
bdev_ftl.h bdev/ftl: construct_ftl_bdev respects default ftl config 2019-07-01 14:46:26 +00:00
bdev_nvme_rpc.c nvme: fix json response on failed construct_nvme_bdev RPCs 2019-08-09 16:35:00 +00:00
bdev_nvme.c bdev/nvme: deprecate ResetControllerOnTimeout configuration option 2019-08-09 00:44:50 +00:00
bdev_nvme.h bdev/nvme: configure the number of requests allocated for one NVMe I/O queue via RPC 2019-07-29 22:52:39 +00:00
common.c bdev/nvme: Move functions related to NVMe controller to common.c 2019-03-08 12:47:53 +00:00
common.h bdev/nvme: Move functions related to NVMe controller to common.c 2019-03-08 12:47:53 +00:00
Makefile bdev/nvme: always enable FTL 2019-05-02 08:41:56 +00:00
nvme_rpc.c jsonrpc: don't check returned value from spdk_jsonrpc_begin_result() 2019-07-22 05:13:30 +00:00