]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 8 Dec 2016 00:56:06 +0000 (16:56 -0800)
committerMike Snitzer <snitzer@redhat.com>
Thu, 8 Dec 2016 19:12:53 +0000 (14:12 -0500)
When dm_table_set_type() is used by a target to establish a DM table's
type (e.g. DM_TYPE_MQ_REQUEST_BASED in the case of DM multipath) the
DM core must go on to verify that the devices in the table are
compatible with the established type.

Fixes: e83068a5 ("dm mpath: add optional "queue_mode" feature")
Cc: stable@vger.kernel.org # 4.8+
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-table.c

index 53b817b291344a28fd46715b3cbcaa1b5bbfcb1a..5ac239d0f78763d120a2110a265738e9c9ca6811 100644 (file)
@@ -981,6 +981,11 @@ verify_rq_based:
                t->all_blk_mq = true;
        }
 
+       if (t->type == DM_TYPE_MQ_REQUEST_BASED && !t->all_blk_mq) {
+               DMERR("table load rejected: all devices are not blk-mq request-stackable");
+               return -EINVAL;
+       }
+
        return 0;
 }