|
@@ -1298,21 +1298,22 @@ static int table_load(struct dm_ioctl *param, size_t param_size)
|
|
|
goto err_unlock_md_type;
|
|
|
}
|
|
|
|
|
|
- if (dm_get_md_type(md) == DM_TYPE_NONE)
|
|
|
+ if (dm_get_md_type(md) == DM_TYPE_NONE) {
|
|
|
/* Initial table load: acquire type of table. */
|
|
|
dm_set_md_type(md, dm_table_get_type(t));
|
|
|
- else if (dm_get_md_type(md) != dm_table_get_type(t)) {
|
|
|
+
|
|
|
+ /* setup md->queue to reflect md's type (may block) */
|
|
|
+ r = dm_setup_md_queue(md);
|
|
|
+ if (r) {
|
|
|
+ DMWARN("unable to set up device queue for new table.");
|
|
|
+ goto err_unlock_md_type;
|
|
|
+ }
|
|
|
+ } else if (dm_get_md_type(md) != dm_table_get_type(t)) {
|
|
|
DMWARN("can't change device type after initial table load.");
|
|
|
r = -EINVAL;
|
|
|
goto err_unlock_md_type;
|
|
|
}
|
|
|
|
|
|
- /* setup md->queue to reflect md's type (may block) */
|
|
|
- r = dm_setup_md_queue(md);
|
|
|
- if (r) {
|
|
|
- DMWARN("unable to set up device queue for new table.");
|
|
|
- goto err_unlock_md_type;
|
|
|
- }
|
|
|
dm_unlock_md_type(md);
|
|
|
|
|
|
/* stage inactive table */
|