summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2016-12-07 16:56:06 -0800
committerMike Snitzer <snitzer@redhat.com>2016-12-08 14:12:53 -0500
commit301fc3f5efb98633115bd887655b19f42c6dfaa8 (patch)
tree90b04d442a6e3ef5435730e16ade9eaa43a2acd7 /drivers
parent6936c12cf809850180b24947271b8f068fdb15e9 (diff)
downloadlinux-stable-301fc3f5efb98633115bd887655b19f42c6dfaa8.tar.gz
linux-stable-301fc3f5efb98633115bd887655b19f42c6dfaa8.tar.bz2
linux-stable-301fc3f5efb98633115bd887655b19f42c6dfaa8.zip
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-table.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 53b817b29134..5ac239d0f787 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -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;
}