Skip to content

Commit

Permalink
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
Browse files Browse the repository at this point in the history
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: e83068a ("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>
  • Loading branch information
Bart Van Assche authored and Mike Snitzer committed Dec 8, 2016
1 parent 6936c12 commit 301fc3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,11 @@ static int dm_table_determine_type(struct dm_table *t)
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;
}

Expand Down

0 comments on commit 301fc3f

Please sign in to comment.