Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110115
b: refs/heads/master
c: 7253a33
h: refs/heads/master
i:
  110113: e13153a
  110111: c6a9995
v: v3
  • Loading branch information
Chandra Seetharaman authored and Alasdair G Kergon committed Oct 1, 2008
1 parent b321de4 commit a5c67a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b01cd5ac43b00c49759c126c21e7d22c7e80b245
refs/heads/master: 7253a33434245ee8243897559188186df65f3611
16 changes: 15 additions & 1 deletion trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct multipath {

const char *hw_handler_name;
struct work_struct activate_path;
struct pgpath *pgpath_to_activate;
unsigned nr_priority_groups;
struct list_head priority_groups;
unsigned pg_init_required; /* pg_init needs calling? */
Expand Down Expand Up @@ -146,6 +147,7 @@ static struct priority_group *alloc_priority_group(void)

static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti)
{
unsigned long flags;
struct pgpath *pgpath, *tmp;
struct multipath *m = ti->private;

Expand All @@ -154,6 +156,10 @@ static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti)
if (m->hw_handler_name)
scsi_dh_detach(bdev_get_queue(pgpath->path.dev->bdev));
dm_put_device(ti, pgpath->path.dev);
spin_lock_irqsave(&m->lock, flags);
if (m->pgpath_to_activate == pgpath)
m->pgpath_to_activate = NULL;
spin_unlock_irqrestore(&m->lock, flags);
free_pgpath(pgpath);
}
}
Expand Down Expand Up @@ -421,6 +427,7 @@ static void process_queued_ios(struct work_struct *work)
__choose_pgpath(m);

pgpath = m->current_pgpath;
m->pgpath_to_activate = m->current_pgpath;

if ((pgpath && !m->queue_io) ||
(!pgpath && !m->queue_if_no_path))
Expand Down Expand Up @@ -1093,8 +1100,15 @@ static void activate_path(struct work_struct *work)
int ret;
struct multipath *m =
container_of(work, struct multipath, activate_path);
struct dm_path *path = &m->current_pgpath->path;
struct dm_path *path;
unsigned long flags;

spin_lock_irqsave(&m->lock, flags);
path = &m->pgpath_to_activate->path;
m->pgpath_to_activate = NULL;
spin_unlock_irqrestore(&m->lock, flags);
if (!path)
return;
ret = scsi_dh_activate(bdev_get_queue(path->dev->bdev));
pg_init_done(path, ret);
}
Expand Down

0 comments on commit a5c67a0

Please sign in to comment.