From: Mike Snitzer <snitzer@redhat.com>
To: christophe.varoqui@opensvc.com
Cc: dm-devel@redhat.com
Subject: [PATCH] multipathd: use 0 for initial pg if there are no priority groups
Date: Wed, 20 Apr 2011 17:24:00 -0400 [thread overview]
Message-ID: <20110420212400.GA6114@redhat.com> (raw)
dm-multipath now accommodates a DM table that doesn't have any priority
groups, see: http://git.kernel.org/linus/a490a07a67b7a37
That kernel change imposes that multipathd must pass 0 for the initial
priority group if there aren't any priority groups (currently passes 1).
There is no need to check the multipath target version to decide whether
to pass an initial_pg of 0 or 1 because until recently dm-multipath
never accommodated a DM table with no priority groups.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
libmultipath/dmparser.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index 1ef3aad..0803bec 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -52,6 +52,7 @@ assemble_map (struct multipath * mp)
int i, j;
int shift, freechar;
int minio;
+ int nr_priority_groups, initial_pg_nr;
char * p;
struct pathgroup * pgp;
struct path * pp;
@@ -60,9 +61,12 @@ assemble_map (struct multipath * mp)
p = mp->params;
freechar = sizeof(mp->params);
+ nr_priority_groups = VECTOR_SIZE(mp->pg);
+ initial_pg_nr = (nr_priority_groups ? mp->bestpg : 0);
+
shift = snprintf(p, freechar, "%s %s %i %i",
mp->features, mp->hwhandler,
- VECTOR_SIZE(mp->pg), mp->bestpg);
+ nr_priority_groups, initial_pg_nr);
if (shift >= freechar) {
fprintf(stderr, "mp->params too small\n");
--
1.7.3.4
next reply other threads:[~2011-04-20 21:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 21:24 Mike Snitzer [this message]
2011-04-21 4:35 ` [PATCH] multipathd: use 0 for initial pg if there are no priority groups Christophe Varoqui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110420212400.GA6114@redhat.com \
--to=snitzer@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.