Patch 2.6.32.28 to 2.6.32.32
/drivers/md/dm-mpath.c
blob:fcf717cb2684e7ac56cbd951e8152d881a3aa6b4 -> blob:f336c695908217610a0d4a66e0ae2e27a68e85a0
--- drivers/md/dm-mpath.c
+++ drivers/md/dm-mpath.c
@@ -33,6 +33,7 @@ struct pgpath {
unsigned fail_count; /* Cumulative failure count */
struct dm_path path;
+ struct work_struct deactivate_path;
struct work_struct activate_path;
};
@@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipa
static void process_queued_ios(struct work_struct *work);
static void trigger_event(struct work_struct *work);
static void activate_path(struct work_struct *work);
+static void deactivate_path(struct work_struct *work);
/*-----------------------------------------------
@@ -124,6 +126,7 @@ static struct pgpath *alloc_pgpath(void)
if (pgpath) {
pgpath->is_active = 1;
+ INIT_WORK(&pgpath->deactivate_path, deactivate_path);
INIT_WORK(&pgpath->activate_path, activate_path);
}
@@ -135,6 +138,14 @@ static void free_pgpath(struct pgpath *p
kfree(pgpath);
}
+static void deactivate_path(struct work_struct *work)
+{
+ struct pgpath *pgpath =
+ container_of(work, struct pgpath, deactivate_path);
+
+ blk_abort_queue(pgpath->path.dev->bdev->bd_disk->queue);
+}
+
static struct priority_group *alloc_priority_group(void)
{
struct priority_group *pg;
@@ -938,6 +949,7 @@ static int fail_path(struct pgpath *pgpa
pgpath->path.dev->name, m->nr_valid_paths);
schedule_work(&m->trigger_event);
+ queue_work(kmultipathd, &pgpath->deactivate_path);
out:
spin_unlock_irqrestore(&m->lock, flags);