diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-ioctl.c | 9 | ||||
-rw-r--r-- | drivers/md/dm-mpath.c | 16 |
2 files changed, 19 insertions, 6 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 200a0688f717..54ec737195e0 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -230,11 +230,20 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi | |||
230 | 230 | ||
231 | static void __hash_remove(struct hash_cell *hc) | 231 | static void __hash_remove(struct hash_cell *hc) |
232 | { | 232 | { |
233 | struct dm_table *table; | ||
234 | |||
233 | /* remove from the dev hash */ | 235 | /* remove from the dev hash */ |
234 | list_del(&hc->uuid_list); | 236 | list_del(&hc->uuid_list); |
235 | list_del(&hc->name_list); | 237 | list_del(&hc->name_list); |
236 | unregister_with_devfs(hc); | 238 | unregister_with_devfs(hc); |
237 | dm_set_mdptr(hc->md, NULL); | 239 | dm_set_mdptr(hc->md, NULL); |
240 | |||
241 | table = dm_get_table(hc->md); | ||
242 | if (table) { | ||
243 | dm_table_event(table); | ||
244 | dm_table_put(table); | ||
245 | } | ||
246 | |||
238 | dm_put(hc->md); | 247 | dm_put(hc->md); |
239 | if (hc->new_map) | 248 | if (hc->new_map) |
240 | dm_table_put(hc->new_map); | 249 | dm_table_put(hc->new_map); |
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 785806bdb248..f9b7b32d5d5c 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -329,13 +329,17 @@ static int map_io(struct multipath *m, struct bio *bio, struct mpath_io *mpio, | |||
329 | /* | 329 | /* |
330 | * If we run out of usable paths, should we queue I/O or error it? | 330 | * If we run out of usable paths, should we queue I/O or error it? |
331 | */ | 331 | */ |
332 | static int queue_if_no_path(struct multipath *m, unsigned queue_if_no_path) | 332 | static int queue_if_no_path(struct multipath *m, unsigned queue_if_no_path, |
333 | unsigned save_old_value) | ||
333 | { | 334 | { |
334 | unsigned long flags; | 335 | unsigned long flags; |
335 | 336 | ||
336 | spin_lock_irqsave(&m->lock, flags); | 337 | spin_lock_irqsave(&m->lock, flags); |
337 | 338 | ||
338 | m->saved_queue_if_no_path = m->queue_if_no_path; | 339 | if (save_old_value) |
340 | m->saved_queue_if_no_path = m->queue_if_no_path; | ||
341 | else | ||
342 | m->saved_queue_if_no_path = queue_if_no_path; | ||
339 | m->queue_if_no_path = queue_if_no_path; | 343 | m->queue_if_no_path = queue_if_no_path; |
340 | if (!m->queue_if_no_path && m->queue_size) | 344 | if (!m->queue_if_no_path && m->queue_size) |
341 | queue_work(kmultipathd, &m->process_queued_ios); | 345 | queue_work(kmultipathd, &m->process_queued_ios); |
@@ -677,7 +681,7 @@ static int parse_features(struct arg_set *as, struct multipath *m, | |||
677 | return 0; | 681 | return 0; |
678 | 682 | ||
679 | if (!strnicmp(shift(as), MESG_STR("queue_if_no_path"))) | 683 | if (!strnicmp(shift(as), MESG_STR("queue_if_no_path"))) |
680 | return queue_if_no_path(m, 1); | 684 | return queue_if_no_path(m, 1, 0); |
681 | else { | 685 | else { |
682 | ti->error = "Unrecognised multipath feature request"; | 686 | ti->error = "Unrecognised multipath feature request"; |
683 | return -EINVAL; | 687 | return -EINVAL; |
@@ -1077,7 +1081,7 @@ static void multipath_presuspend(struct dm_target *ti) | |||
1077 | { | 1081 | { |
1078 | struct multipath *m = (struct multipath *) ti->private; | 1082 | struct multipath *m = (struct multipath *) ti->private; |
1079 | 1083 | ||
1080 | queue_if_no_path(m, 0); | 1084 | queue_if_no_path(m, 0, 1); |
1081 | } | 1085 | } |
1082 | 1086 | ||
1083 | /* | 1087 | /* |
@@ -1222,9 +1226,9 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv) | |||
1222 | 1226 | ||
1223 | if (argc == 1) { | 1227 | if (argc == 1) { |
1224 | if (!strnicmp(argv[0], MESG_STR("queue_if_no_path"))) | 1228 | if (!strnicmp(argv[0], MESG_STR("queue_if_no_path"))) |
1225 | return queue_if_no_path(m, 1); | 1229 | return queue_if_no_path(m, 1, 0); |
1226 | else if (!strnicmp(argv[0], MESG_STR("fail_if_no_path"))) | 1230 | else if (!strnicmp(argv[0], MESG_STR("fail_if_no_path"))) |
1227 | return queue_if_no_path(m, 0); | 1231 | return queue_if_no_path(m, 0, 0); |
1228 | } | 1232 | } |
1229 | 1233 | ||
1230 | if (argc != 2) | 1234 | if (argc != 2) |