diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 4702f380cb45..ed8585954a3a 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1189,7 +1189,7 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1189 | goto out; | 1189 | goto out; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | /* Protect md->type against concurrent table loads. */ | 1192 | /* Protect md->type and md->queue against concurrent table loads. */ |
1193 | dm_lock_md_type(md); | 1193 | dm_lock_md_type(md); |
1194 | if (dm_get_md_type(md) == DM_TYPE_NONE) | 1194 | if (dm_get_md_type(md) == DM_TYPE_NONE) |
1195 | /* Initial table load: acquire type of table. */ | 1195 | /* Initial table load: acquire type of table. */ |
@@ -1201,6 +1201,15 @@ static int table_load(struct dm_ioctl *param, size_t param_size) | |||
1201 | r = -EINVAL; | 1201 | r = -EINVAL; |
1202 | goto out; | 1202 | goto out; |
1203 | } | 1203 | } |
1204 | |||
1205 | /* setup md->queue to reflect md's type (may block) */ | ||
1206 | r = dm_setup_md_queue(md); | ||
1207 | if (r) { | ||
1208 | DMWARN("unable to set up device queue for new table."); | ||
1209 | dm_table_destroy(t); | ||
1210 | dm_unlock_md_type(md); | ||
1211 | goto out; | ||
1212 | } | ||
1204 | dm_unlock_md_type(md); | 1213 | dm_unlock_md_type(md); |
1205 | 1214 | ||
1206 | /* stage inactive table */ | 1215 | /* stage inactive table */ |