@@ -936,30 +936,27 @@ static int dm_table_determine_type(struct dm_table *t)
if (list_empty(devices)) {
int srcu_idx;
struct dm_table *live_table = dm_get_live_table(t->md, &srcu_idx);
/* inherit live table's type */
if (live_table)
t->type = live_table->type;
dm_put_live_table(t->md, srcu_idx);
return 0;
}
- tgt = dm_table_get_immutable_target(t);
- if (!tgt) {
- DMERR("table load rejected: immutable target is required");
- return -EINVAL;
- } else if (tgt->max_io_len) {
- DMERR("table load rejected: immutable target that splits IO is not supported");
+ tgt = &t->targets[0];
+ if (tgt->max_io_len) {
+ DMERR("table load rejected: singleton target that splits IO is not supported");
return -EINVAL;
}
/* Non-request-stackable devices can't be used for request-based dm */
if (!tgt->type->iterate_devices ||
!tgt->type->iterate_devices(tgt, device_is_rq_stackable, NULL)) {
DMERR("table load rejected: including non-request-stackable devices");
return -EINVAL;
}
return 0;
}