Commit 3837f0d0 authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

bdev: don't allow NVME_IO types for partitioned bdevs



Typically we just pass the bdevs supported IO types
for each of its partitions.  But that doesn't work
for partitions with non-zero offsets since we can't
decode/modify the NVMe command in the bdev layer
to account for that offset.  So just don't allow it.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I38a766fcc39d5f068b31245bf1a47dbb79c8f8dd

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent d58732d7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -146,6 +146,19 @@ spdk_bdev_part_io_type_supported(void *_part, enum spdk_bdev_io_type io_type)
{
	struct spdk_bdev_part *part = _part;

	/* We can't decode/modify passthrough NVMe commands, so don't report
	 *  that a partition supports these io types, even if the underlying
	 *  bdev does.
	 */
	switch (io_type) {
	case SPDK_BDEV_IO_TYPE_NVME_ADMIN:
	case SPDK_BDEV_IO_TYPE_NVME_IO:
	case SPDK_BDEV_IO_TYPE_NVME_IO_MD:
		return false;
	default:
		break;
	}

	return part->internal.base->bdev->fn_table->io_type_supported(part->internal.base->bdev->ctxt,
			io_type);
}