dm table: fix NVMe bio-based dm_table_determine_type() validation
authorMike Snitzer <snitzer@redhat.com>
Sat, 13 Jan 2018 19:33:30 +0000 (14:33 -0500)
committerMike Snitzer <snitzer@redhat.com>
Mon, 29 Jan 2018 18:44:56 +0000 (13:44 -0500)
commiteaa160ededfad7a38f7ee06dc1af2ced1b410ad8
treeb2384ffc90fa224beabb9878fc0c1bc5faa50cdf
parentc12c9a3c3860c76ba273798c0c34c6f1294cc759
dm table: fix NVMe bio-based dm_table_determine_type() validation

The 'verify_rq_based:' code in dm_table_determine_type() was checking
all devices in the DM table rather than only checking the data devices.
Fix this by using the immutable target's iterate_devices method.

Also, tweak the block of dm_table_determine_type() code that decides
whether to upgrade from DM_TYPE_BIO_BASED to DM_TYPE_NVME_BIO_BASED so
that it makes sure the immutable_target doesn't support require
splitting IOs.

These changes have been verified to allow a "thin-pool" target whose
data device is an NVMe device to be upgraded to DM_TYPE_NVME_BIO_BASED.
Using the thin-pool in NVMe bio-based mode was verified to pass all the
device-mapper-test-suite's "thin-provisioning" tests.

Also verified that request-based DM multipath (with queue_mode "rq" and
"mq") works as expected using the 'mptest' harness.

Fixes: 22c11858e ("dm: introduce DM_TYPE_NVME_BIO_BASED")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-table.c