diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 17 |
1 files changed, 9 insertions, 8 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 */ |