]>
Commit | Line | Data |
---|---|---|
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 | |
5 | References: bnc#434105 | |
6 | ||
7 | Another small bugfix for request timeout. | |
8 | ||
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> | |
12 | ||
13 | --- | |
14 | drivers/md/dm-mpath.c | 15 ++++++++++++++- | |
15 | 1 file changed, 14 insertions(+), 1 deletion(-) | |
16 | ||
17 | --- a/drivers/md/dm-mpath.c | |
18 | +++ b/drivers/md/dm-mpath.c | |
19 | @@ -33,6 +33,7 @@ struct pgpath { | |
20 | unsigned fail_count; /* Cumulative failure count */ | |
21 | ||
22 | struct dm_path path; | |
23 | + struct work_struct deactivate_path; | |
24 | }; | |
25 | ||
26 | #define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path) | |
27 | @@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipa | |
28 | static void process_queued_ios(struct work_struct *work); | |
29 | static void trigger_event(struct work_struct *work); | |
30 | static void activate_path(struct work_struct *work); | |
31 | +static void deactivate_path(struct work_struct *work); | |
32 | ||
33 | ||
34 | /*----------------------------------------------- | |
35 | @@ -122,8 +124,10 @@ static struct pgpath *alloc_pgpath(void) | |
36 | { | |
37 | struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); | |
38 | ||
39 | - if (pgpath) | |
40 | + if (pgpath) { | |
41 | pgpath->path.is_active = 1; | |
42 | + INIT_WORK(&pgpath->deactivate_path, deactivate_path); | |
43 | + } | |
44 | ||
45 | return pgpath; | |
46 | } | |
47 | @@ -133,6 +137,14 @@ static void free_pgpath(struct pgpath *p | |
48 | kfree(pgpath); | |
49 | } | |
50 | ||
51 | +static void deactivate_path(struct work_struct *work) | |
52 | +{ | |
53 | + struct pgpath *pgpath = | |
54 | + container_of(work, struct pgpath, deactivate_path); | |
55 | + | |
56 | + blk_abort_queue(pgpath->path.dev->bdev->bd_disk->queue); | |
57 | +} | |
58 | + | |
59 | static struct priority_group *alloc_priority_group(void) | |
60 | { | |
61 | struct priority_group *pg; | |
62 | @@ -881,6 +893,7 @@ static int fail_path(struct pgpath *pgpa | |
63 | pgpath->path.dev->name, m->nr_valid_paths); | |
64 | ||
65 | queue_work(kmultipathd, &m->trigger_event); | |
66 | + queue_work(kmultipathd, &pgpath->deactivate_path); | |
67 | ||
68 | out: | |
69 | spin_unlock_irqrestore(&m->lock, flags); |