1 Subject: dm: Call blk_abort_queue on failed paths
2 From: Mike Anderson <andmike@linux.vnet.ibm.com>
3 Date: Thu Oct 9 08:56:14 2008 +0200:
4 Git: 224cb3e981f1b2f9f93dbd49eaef505d17d894c2
7 Another small bugfix for request timeout.
9 Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
10 Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
11 Signed-off-by: Hannes Reinecke <hare@suse.de>
13 diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
14 index c2fcf28..3d38481 100644
15 --- a/drivers/md/dm-mpath.c
16 +++ b/drivers/md/dm-mpath.c
17 @@ -33,6 +33,7 @@ struct pgpath {
18 unsigned fail_count; /* Cumulative failure count */
21 + struct work_struct deactivate_path;
24 #define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path)
25 @@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipathd, *kmpath_handlerd;
26 static void process_queued_ios(struct work_struct *work);
27 static void trigger_event(struct work_struct *work);
28 static void activate_path(struct work_struct *work);
29 +static void deactivate_path(struct work_struct *work);
32 /*-----------------------------------------------
33 @@ -122,8 +124,10 @@ static struct pgpath *alloc_pgpath(void)
35 struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
39 pgpath->path.is_active = 1;
40 + INIT_WORK(&pgpath->deactivate_path, deactivate_path);
45 @@ -133,6 +137,14 @@ static void free_pgpath(struct pgpath *pgpath)
49 +static void deactivate_path(struct work_struct *work)
51 + struct pgpath *pgpath =
52 + container_of(work, struct pgpath, deactivate_path);
54 + blk_abort_queue(pgpath->path.dev->bdev->bd_disk->queue);
57 static struct priority_group *alloc_priority_group(void)
59 struct priority_group *pg;
60 @@ -870,6 +882,7 @@ static int fail_path(struct pgpath *pgpath)
61 pgpath->path.dev->name, m->nr_valid_paths);
63 queue_work(kmultipathd, &m->trigger_event);
64 + queue_work(kmultipathd, &pgpath->deactivate_path);
67 spin_unlock_irqrestore(&m->lock, flags);