Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242565
b: refs/heads/master
c: a490a07
h: refs/heads/master
i:
  242563: a764321
v: v3
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Mar 24, 2011
1 parent 22a6db6 commit 7ec2b58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: 19040c0bc8efcb767221d8ef7bb9c32ff0586179
refs/heads/master: a490a07a67b7a37f588021410e06b721a752fc34
13 changes: 10 additions & 3 deletions trunk/drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
{
/* target parameters */
static struct param _params[] = {
{1, 1024, "invalid number of priority groups"},
{1, 1024, "invalid initial priority group number"},
{0, 1024, "invalid number of priority groups"},
{0, 1024, "invalid initial priority group number"},
};

int r;
Expand Down Expand Up @@ -879,6 +879,13 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
if (r)
goto bad;

if ((!m->nr_priority_groups && next_pg_num) ||
(m->nr_priority_groups && !next_pg_num)) {
ti->error = "invalid initial priority group";
r = -EINVAL;
goto bad;
}

/* parse the priority groups */
while (as.argc) {
struct priority_group *pg;
Expand Down Expand Up @@ -1415,7 +1422,7 @@ static int multipath_status(struct dm_target *ti, status_type_t type,
else if (m->current_pg)
pg_num = m->current_pg->pg_num;
else
pg_num = 1;
pg_num = (m->nr_priority_groups ? 1 : 0);

DMEMIT("%u ", pg_num);

Expand Down

0 comments on commit 7ec2b58

Please sign in to comment.