diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-12-07 19:56:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-06 04:40:15 -0500 |
commit | e74fb822281ecd034a381b0c3dd1b9d63caf1f25 (patch) | |
tree | 711d3b929494eb67e1f2b72377679276b45a671b /drivers | |
parent | 470b6910f7c1d492884fc4c741bd1011a8ac4205 (diff) |
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
commit 301fc3f5efb98633115bd887655b19f42c6dfaa8 upstream.
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")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-table.c | 5 |
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: | |||
981 | t->all_blk_mq = true; | 981 | t->all_blk_mq = true; |
982 | } | 982 | } |
983 | 983 | ||
984 | if (t->type == DM_TYPE_MQ_REQUEST_BASED && !t->all_blk_mq) { | ||
985 | DMERR("table load rejected: all devices are not blk-mq request-stackable"); | ||
986 | return -EINVAL; | ||
987 | } | ||
988 | |||
984 | return 0; | 989 | return 0; |
985 | } | 990 | } |
986 | 991 | ||