diff options
-rw-r--r-- | drivers/md/dm-ioctl.c | 17 | ||||
-rw-r--r-- | drivers/md/dm.c | 3 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index c8a18e4ee9dc..720ceeb7fa9b 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1298,21 +1298,22 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1298 | goto err_unlock_md_type; | 1298 | goto err_unlock_md_type; |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | if (dm_get_md_type(md) == DM_TYPE_NONE) | 1301 | if (dm_get_md_type(md) == DM_TYPE_NONE) { |
1302 | /* Initial table load: acquire type of table. */ | 1302 | /* Initial table load: acquire type of table. */ |
1303 | dm_set_md_type(md, dm_table_get_type(t)); | 1303 | dm_set_md_type(md, dm_table_get_type(t)); |
1304 | else if (dm_get_md_type(md) != dm_table_get_type(t)) { | 1304 | |
1305 | /* setup md->queue to reflect md's type (may block) */ | ||
1306 | r = dm_setup_md_queue(md); | ||
1307 | if (r) { | ||
1308 | DMWARN("unable to set up device queue for new table."); | ||
1309 | goto err_unlock_md_type; | ||
1310 | } | ||
1311 | } else if (dm_get_md_type(md) != dm_table_get_type(t)) { | ||
1305 | DMWARN("can't change device type after initial table load."); | 1312 | DMWARN("can't change device type after initial table load."); |
1306 | r = -EINVAL; | 1313 | r = -EINVAL; |
1307 | goto err_unlock_md_type; | 1314 | goto err_unlock_md_type; |
1308 | } | 1315 | } |
1309 | 1316 | ||
1310 | /* setup md->queue to reflect md's type (may block) */ | ||
1311 | r = dm_setup_md_queue(md); | ||
1312 | if (r) { | ||
1313 | DMWARN("unable to set up device queue for new table."); | ||
1314 | goto err_unlock_md_type; | ||
1315 | } | ||
1316 | dm_unlock_md_type(md); | 1317 | dm_unlock_md_type(md); |
1317 | 1318 | ||
1318 | /* stage inactive table */ | 1319 | /* stage inactive table */ |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f8c7ca3e8947..923496ba72a0 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -2662,9 +2662,6 @@ static int dm_init_request_based_queue(struct mapped_device *md) | |||
2662 | { | 2662 | { |
2663 | struct request_queue *q = NULL; | 2663 | struct request_queue *q = NULL; |
2664 | 2664 | ||
2665 | if (md->queue->elevator) | ||
2666 | return 0; | ||
2667 | |||
2668 | /* Fully initialize the queue */ | 2665 | /* Fully initialize the queue */ |
2669 | q = blk_init_allocated_queue(md->queue, dm_request_fn, NULL); | 2666 | q = blk_init_allocated_queue(md->queue, dm_request_fn, NULL); |
2670 | if (!q) | 2667 | if (!q) |