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: Jim Harris <james.r.harris@intel.com>
Change-Id: I38a766fcc39d5f068b31245bf1a47dbb79c8f8dd

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452930
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Jim Harris 2019-05-02 15:58:56 -07:00 committed by Changpeng Liu
parent d58732d75e
commit 3837f0d0f5

View File

@ -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);
}