blob: pass correct op to spdk_bs_user_op_alloc in iov case

At some point this parameter may have been a bool, but it's
not now - so we need to explicitly pass SPDK_BLOB_READV or
SPDK_BLOB_WRITEV.

Otherwise we end up trying to write the iovec array as the
data buffer when executing this operation later - since we
passed "false" which is treated as 0 which is
SPDK_BLOB_WRITE (not SPDK_BLOB_WRITEV).

Fixes issue #603.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I50df736216c4a88b40604722c021e204c7fac623

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452157
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jim Harris 2019-04-25 15:24:34 -07:00 committed by Darek Stojaczyk
parent 550d1b2e24
commit 9e1116ea83

View File

@ -2114,10 +2114,12 @@ _spdk_blob_request_submit_rw_iov(struct spdk_blob *blob, struct spdk_io_channel
cpl.u.blob_basic.cb_arg = cb_arg; cpl.u.blob_basic.cb_arg = cb_arg;
if (blob->frozen_refcnt) { if (blob->frozen_refcnt) {
/* This blob I/O is frozen */ /* This blob I/O is frozen */
enum spdk_blob_op_type op_type;
spdk_bs_user_op_t *op; spdk_bs_user_op_t *op;
struct spdk_bs_channel *bs_channel = spdk_io_channel_get_ctx(_channel); struct spdk_bs_channel *bs_channel = spdk_io_channel_get_ctx(_channel);
op = spdk_bs_user_op_alloc(_channel, &cpl, read, blob, iov, iovcnt, offset, length); op_type = read ? SPDK_BLOB_READV : SPDK_BLOB_WRITEV;
op = spdk_bs_user_op_alloc(_channel, &cpl, op_type, blob, iov, iovcnt, offset, length);
if (!op) { if (!op) {
cb_fn(cb_arg, -ENOMEM); cb_fn(cb_arg, -ENOMEM);
return; return;