Skip to content

Commit

Permalink
dm: Call blk_abort_queue on failed paths
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Mike Anderson authored and Jens Axboe committed Oct 9, 2008
1 parent 11914a5 commit 224cb3e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct pgpath {
unsigned fail_count; /* Cumulative failure count */

struct dm_path path;
struct work_struct deactivate_path;
};

#define path_to_pgpath(__pgp) container_of((__pgp), struct pgpath, path)
Expand Down Expand Up @@ -112,6 +113,7 @@ static struct workqueue_struct *kmultipathd, *kmpath_handlerd;
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);


/*-----------------------------------------------
Expand All @@ -122,8 +124,10 @@ static struct pgpath *alloc_pgpath(void)
{
struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);

if (pgpath)
if (pgpath) {
pgpath->path.is_active = 1;
INIT_WORK(&pgpath->deactivate_path, deactivate_path);
}

return pgpath;
}
Expand All @@ -133,6 +137,14 @@ static void free_pgpath(struct pgpath *pgpath)
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;
Expand Down Expand Up @@ -870,6 +882,7 @@ static int fail_path(struct pgpath *pgpath)
pgpath->path.dev->name, m->nr_valid_paths);

queue_work(kmultipathd, &m->trigger_event);
queue_work(kmultipathd, &pgpath->deactivate_path);

out:
spin_unlock_irqrestore(&m->lock, flags);
Expand Down

0 comments on commit 224cb3e

Please sign in to comment.