diff options
| -rw-r--r-- | drivers/md/dm-mpath.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index fa0f6cbd6a41..ebfa411d1a7d 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
| @@ -445,11 +445,11 @@ static int queue_if_no_path(struct multipath *m, unsigned queue_if_no_path, | |||
| 445 | else | 445 | else |
| 446 | m->saved_queue_if_no_path = queue_if_no_path; | 446 | m->saved_queue_if_no_path = queue_if_no_path; |
| 447 | m->queue_if_no_path = queue_if_no_path; | 447 | m->queue_if_no_path = queue_if_no_path; |
| 448 | if (!m->queue_if_no_path) | ||
| 449 | dm_table_run_md_queue_async(m->ti->table); | ||
| 450 | |||
| 451 | spin_unlock_irqrestore(&m->lock, flags); | 448 | spin_unlock_irqrestore(&m->lock, flags); |
| 452 | 449 | ||
| 450 | if (!queue_if_no_path) | ||
| 451 | dm_table_run_md_queue_async(m->ti->table); | ||
| 452 | |||
| 453 | return 0; | 453 | return 0; |
| 454 | } | 454 | } |
| 455 | 455 | ||
| @@ -954,7 +954,7 @@ out: | |||
| 954 | */ | 954 | */ |
| 955 | static int reinstate_path(struct pgpath *pgpath) | 955 | static int reinstate_path(struct pgpath *pgpath) |
| 956 | { | 956 | { |
| 957 | int r = 0; | 957 | int r = 0, run_queue = 0; |
| 958 | unsigned long flags; | 958 | unsigned long flags; |
| 959 | struct multipath *m = pgpath->pg->m; | 959 | struct multipath *m = pgpath->pg->m; |
| 960 | 960 | ||
| @@ -978,7 +978,7 @@ static int reinstate_path(struct pgpath *pgpath) | |||
| 978 | 978 | ||
| 979 | if (!m->nr_valid_paths++) { | 979 | if (!m->nr_valid_paths++) { |
| 980 | m->current_pgpath = NULL; | 980 | m->current_pgpath = NULL; |
| 981 | dm_table_run_md_queue_async(m->ti->table); | 981 | run_queue = 1; |
| 982 | } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { | 982 | } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { |
| 983 | if (queue_work(kmpath_handlerd, &pgpath->activate_path.work)) | 983 | if (queue_work(kmpath_handlerd, &pgpath->activate_path.work)) |
| 984 | m->pg_init_in_progress++; | 984 | m->pg_init_in_progress++; |
| @@ -991,6 +991,8 @@ static int reinstate_path(struct pgpath *pgpath) | |||
| 991 | 991 | ||
| 992 | out: | 992 | out: |
| 993 | spin_unlock_irqrestore(&m->lock, flags); | 993 | spin_unlock_irqrestore(&m->lock, flags); |
| 994 | if (run_queue) | ||
| 995 | dm_table_run_md_queue_async(m->ti->table); | ||
| 994 | 996 | ||
| 995 | return r; | 997 | return r; |
| 996 | } | 998 | } |
| @@ -1566,8 +1568,8 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, | |||
| 1566 | } | 1568 | } |
| 1567 | if (m->pg_init_required) | 1569 | if (m->pg_init_required) |
| 1568 | __pg_init_all_paths(m); | 1570 | __pg_init_all_paths(m); |
| 1569 | dm_table_run_md_queue_async(m->ti->table); | ||
| 1570 | spin_unlock_irqrestore(&m->lock, flags); | 1571 | spin_unlock_irqrestore(&m->lock, flags); |
| 1572 | dm_table_run_md_queue_async(m->ti->table); | ||
| 1571 | } | 1573 | } |
| 1572 | 1574 | ||
| 1573 | return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg); | 1575 | return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg); |
