Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176556
b: refs/heads/master
c: 67a46da
h: refs/heads/master
v: v3
  • Loading branch information
Mike Anderson authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 04c3d14 commit b5cb256
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6380f26f0424034345461cabaab9a7030d905b59
refs/heads/master: 67a46dad25ccc8910995d8671f7ec17a6bc823cb
12 changes: 12 additions & 0 deletions trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ struct multipath {
mempool_t *mpio_pool;

struct mutex work_mutex;

unsigned suspended; /* Don't create new I/O internally when set. */
};

/*
Expand Down Expand Up @@ -1274,6 +1276,7 @@ static void multipath_postsuspend(struct dm_target *ti)
struct multipath *m = ti->private;

mutex_lock(&m->work_mutex);
m->suspended = 1;
flush_multipath_work();
mutex_unlock(&m->work_mutex);
}
Expand All @@ -1286,6 +1289,10 @@ static void multipath_resume(struct dm_target *ti)
struct multipath *m = (struct multipath *) ti->private;
unsigned long flags;

mutex_lock(&m->work_mutex);
m->suspended = 0;
mutex_unlock(&m->work_mutex);

spin_lock_irqsave(&m->lock, flags);
m->queue_if_no_path = m->saved_queue_if_no_path;
spin_unlock_irqrestore(&m->lock, flags);
Expand Down Expand Up @@ -1421,6 +1428,11 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)

mutex_lock(&m->work_mutex);

if (m->suspended) {
r = -EBUSY;
goto out;
}

if (argc == 1) {
if (!strnicmp(argv[0], MESG_STR("queue_if_no_path"))) {
r = queue_if_no_path(m, 1, 0);
Expand Down

0 comments on commit b5cb256

Please sign in to comment.