Commit 66585bd4 authored by Tomasz Kulasek's avatar Tomasz Kulasek Committed by Tomasz Zawadzki
Browse files

lib/nvme: fix cuse return status code



For admin as well as for IO operations the ioctl should return
NVMe status code.

Change-Id: Icf8efde674b847fb03e5532f47c00b1c2cdcf328
Signed-off-by: default avatarTomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477492


Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
parent 3cca1b36
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -105,9 +105,9 @@ cuse_nvme_admin_cmd_cb(void *arg, const struct spdk_nvme_cpl *cpl)
	if (ctx->data_len > 0) {
		out_iov[1].iov_base = ctx->data;
		out_iov[1].iov_len = ctx->data_len;
		fuse_reply_ioctl_iov(ctx->req, 0, out_iov, 2);
		fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, out_iov, 2);
	} else {
		fuse_reply_ioctl_iov(ctx->req, 0, out_iov, 1);
		fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, out_iov, 1);
	}

	cuse_io_ctx_free(ctx);
@@ -260,7 +260,7 @@ cuse_nvme_submit_io_write_done(void *ref, const struct spdk_nvme_cpl *cpl)
{
	struct cuse_io_ctx *ctx = (struct cuse_io_ctx *)ref;

	fuse_reply_ioctl_iov(ctx->req, 0, NULL, 0);
	fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, NULL, 0);

	cuse_io_ctx_free(ctx);
}
@@ -345,7 +345,7 @@ cuse_nvme_submit_io_read_done(void *ref, const struct spdk_nvme_cpl *cpl)
	iov.iov_base = ctx->data;
	iov.iov_len = ctx->data_len;

	fuse_reply_ioctl_iov(ctx->req, 0, &iov, 1);
	fuse_reply_ioctl_iov(ctx->req, cpl->status.sc, &iov, 1);

	cuse_io_ctx_free(ctx);
}