Loading
bdev/nvme: attach_controller RPC returns callback rc as error code
Previously, if the bdev_nvme_attach_controller RPC fails after bdev_nvme_create() is called, SPDK_JSONRPC_ERROR_INVALID_PARAMS was returned as error code. However, this was not good because error code was not consistent for error due to path duplication. If path was duplicated with the current active path, -EALREADY was returned. However, if path was duplicated with any secondary path, SPDK_JSONRPC_ERROR_INVALID_PARAMS was returned. To fix this incosistency, we take two steps. As the first step, in this patch, we change to return callback rc instead of SPDK_JSONRPC_ERROR_INVALID_PARAMS as error code if the RPC fails after bdev_nvme_create() is called. This will be reasonable because if the bdev_nvme_attach_controller RPC fails before bdev_nvme_create() is called, OS error code has been used for all cases but decode error. As the second step, the next patch will change the callback rc for one case to fix a github issue. Signed-off-by:Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23217 (master) (cherry picked from commit fe0d81ba) Change-Id: I49816009d420e9ef23cc683385d78e616a87d4a6 Signed-off-by:
Marek Chomnicki <marek.chomnicki@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23278 Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by:
Jim Harris <jim.harris@samsung.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>