Commit 9e1116ea authored by Jim Harris's avatar Jim Harris Committed by Darek Stojaczyk
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I50df736216c4a88b40604722c021e204c7fac623

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452157


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 550d1b2e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
		if (blob->frozen_refcnt) {
			/* This blob I/O is frozen */
			enum spdk_blob_op_type op_type;
			spdk_bs_user_op_t *op;
			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) {
				cb_fn(cb_arg, -ENOMEM);
				return;