OBS User unknown 2008-10-27 16:02:55 +00:00 committed by Git OBS Bridge
parent c1f5ec65c6
commit 2f690c3436
14 changed files with 1078 additions and 2 deletions

View File

@ -0,0 +1,81 @@
From b0ce6c618b0953b708f4810e763ce307f1bad590 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Mon, 20 Oct 2008 08:49:04 +0200
Subject: [PATCH] Add support for couple of IBM storage devices
Few of the IBM rdac storage devices are not available in the multipath
tools. This patch adds support for those.
Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
libmultipath/hwtable.c | 38 +++++++++++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index cd9a9d2..f87907d 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -358,9 +358,9 @@ static struct hwentry default_hw[] = {
.prio_name = PRIO_RDAC,
},
{
- /* IBM DS3400 */
+ /* IBM DS4100 */
.vendor = "IBM",
- .product = "1726-4xx",
+ .product = "1724",
.getuid = DEFAULT_GETUID,
.features = "1 queue_if_no_path",
.hwhandler = "1 rdac",
@@ -374,7 +374,23 @@ static struct hwentry default_hw[] = {
.prio_name = PRIO_RDAC,
},
{
- /* IBM DS4400 / FAStT700 */
+ /* IBM DS3200 / DS3300 / DS3400 */
+ .vendor = "IBM",
+ .product = "1726",
+ .getuid = DEFAULT_GETUID,
+ .features = "1 queue_if_no_path",
+ .hwhandler = "1 rdac",
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = GROUP_BY_PRIO,
+ .pgfailback = -FAILBACK_IMMEDIATE,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = 300,
+ .minio = DEFAULT_MINIO,
+ .checker_name = RDAC,
+ .prio_name = PRIO_RDAC,
+ },
+ {
+ /* IBM DS4400 / DS4500 / FAStT700 */
.vendor = "IBM",
.product = "1742",
.getuid = DEFAULT_GETUID,
@@ -422,6 +438,22 @@ static struct hwentry default_hw[] = {
.prio_name = PRIO_RDAC,
},
{
+ /* IBM DS5000 */
+ .vendor = "IBM",
+ .product = "1818",
+ .getuid = DEFAULT_GETUID,
+ .features = DEFAULT_FEATURES,
+ .hwhandler = "1 rdac",
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = GROUP_BY_PRIO,
+ .pgfailback = -FAILBACK_IMMEDIATE,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = NO_PATH_RETRY_QUEUE,
+ .minio = DEFAULT_MINIO,
+ .checker_name = RDAC,
+ .prio_name = PRIO_RDAC,
+ },
+ {
/* IBM Netfinity Fibre Channel RAID Controller Unit */
.vendor = "IBM",
.product = "3526",
--
1.5.2.4

View File

@ -0,0 +1,44 @@
From af9e485cddb49d75d89f438c1f0f5ac27802e1e5 Mon Sep 17 00:00:00 2001
From: Jim Lester <jim.lester@compellent.com>
Date: Sun, 21 Sep 2008 12:36:33 +0200
Subject: [PATCH] [lib] new hardware from compellent in defaults table
---
libmultipath/hwtable.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index ada5c55..3e33352 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -18,6 +18,27 @@
*/
static struct hwentry default_hw[] = {
/*
+ * Compellent Technologies, Inc.
+ *
+ * Maintainer : Jim Lester, Compellent
+ * Mail : jim.lester@compellent.com
+ */
+ {
+ .vendor = "COMPELNT",
+ .product = "Compellent Vol",
+ .getuid = DEFAULT_GETUID,
+ .features = DEFAULT_FEATURES,
+ .hwhandler = DEFAULT_HWHANDLER,
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = MULTIBUS,
+ .pgfailback = -FAILBACK_IMMEDIATE,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = NO_PATH_RETRY_QUEUE,
+ .minio = DEFAULT_MINIO,
+ .checker_name = TUR,
+ .prio_name = DEFAULT_PRIO,
+ },
+ /*
* Apple controller family
*
* Maintainer : Shyam Sundar
--
1.5.2.4

View File

@ -0,0 +1,244 @@
From 88eb616ae1a673127ef4fd995d703a8b46a63822 Mon Sep 17 00:00:00 2001
From: Christophe Varoqui <christophe.varoqui@free.fr>
Date: Thu, 11 Sep 2008 00:17:37 +0200
Subject: [PATCH] [multipathd] add "show status" cli command
For now just print the number of paths in each path checker state,
if not zero. For example :
path checker states:
up 2
down 1
ghost 1
---
libmultipath/checkers.c | 15 +++++++++++++++
libmultipath/checkers.h | 18 +++++++++++-------
libmultipath/print.c | 24 ++++++++++++++++++++++++
libmultipath/print.h | 1 +
libmultipath/structs.c | 2 +-
multipathd/cli.c | 1 +
multipathd/cli_handlers.c | 30 ++++++++++++++++++++++++++++++
multipathd/cli_handlers.h | 1 +
multipathd/main.c | 4 +++-
9 files changed, 87 insertions(+), 9 deletions(-)
diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c
index 5889ad7..5132081 100644
--- a/libmultipath/checkers.c
+++ b/libmultipath/checkers.c
@@ -8,8 +8,23 @@
#include "vector.h"
#include "config.h"
+char *checker_state_names[] = {
+ "wild",
+ "unchecked",
+ "down",
+ "up",
+ "shaky",
+ "ghost",
+ "pending"
+};
+
static LIST_HEAD(checkers);
+char * checker_state_name (int i)
+{
+ return checker_state_names[i];
+}
+
int init_checkers (void)
{
INIT_LIST_HEAD(&checkers);
diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h
index a65aaf9..e735250 100644
--- a/libmultipath/checkers.h
+++ b/libmultipath/checkers.h
@@ -47,13 +47,16 @@
* - Use: All async checkers
* - Description: Indicates a check IO is in flight.
*/
-#define PATH_WILD -1
-#define PATH_UNCHECKED 0
-#define PATH_DOWN 1
-#define PATH_UP 2
-#define PATH_SHAKY 3
-#define PATH_GHOST 4
-#define PATH_PENDING 5
+enum path_check_state {
+ PATH_WILD,
+ PATH_UNCHECKED,
+ PATH_DOWN,
+ PATH_UP,
+ PATH_SHAKY,
+ PATH_GHOST,
+ PATH_PENDING,
+ PATH_MAX_STATE
+};
#define DIRECTIO "directio"
#define TUR "tur"
@@ -106,6 +109,7 @@ struct checker {
#define MSG(c, fmt, args...) snprintf((c)->message, CHECKER_MSG_LEN, fmt, ##args);
+char * checker_state_name (int);
int init_checkers (void);
struct checker * add_checker (char *);
struct checker * checker_lookup (char *);
diff --git a/libmultipath/print.c b/libmultipath/print.c
index 08ebd51..459b973 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -1133,6 +1133,30 @@ snprint_blacklist_except (char * buff, int len)
}
extern int
+snprint_status (char * buff, int len, struct vectors *vecs)
+{
+ int fwd = 0;
+ int i;
+ unsigned int count[PATH_MAX_STATE] = {0};
+ struct path * pp;
+
+ vector_foreach_slot (vecs->pathvec, pp, i) {
+ count[pp->state]++;
+ }
+ fwd += snprintf(buff + fwd, len - fwd, "path checker states:\n");
+ for (i=0; i<PATH_MAX_STATE; i++) {
+ if (!count[i])
+ continue;
+ fwd += snprintf(buff + fwd, len - fwd, "%-20s%u\n",
+ checker_state_name(i), count[i]);
+ }
+
+ if (fwd > len)
+ return len;
+ return fwd;
+}
+
+extern int
snprint_devices (char * buff, int len, struct vectors *vecs)
{
DIR *blkdir;
diff --git a/libmultipath/print.h b/libmultipath/print.h
index 5c7023c..1718c94 100644
--- a/libmultipath/print.h
+++ b/libmultipath/print.h
@@ -44,6 +44,7 @@ int snprint_defaults (char *, int);
int snprint_blacklist (char *, int);
int snprint_blacklist_except (char *, int);
int snprint_blacklist_report (char *, int);
+int snprint_status (char *, int, struct vectors *);
int snprint_devices (char *, int, struct vectors *);
int snprint_hwtable (char *, int, vector);
int snprint_mptable (char *, int, vector);
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
index 50f66f4..bb0d9f7 100644
--- a/libmultipath/structs.c
+++ b/libmultipath/structs.c
@@ -349,7 +349,7 @@ pathcountgr (struct pathgroup * pgp, int state)
int i;
vector_foreach_slot (pgp->paths, pp, i)
- if ((pp->state == state) || (state < 0))
+ if ((pp->state == state) || (state == PATH_WILD))
count++;
return count;
diff --git a/multipathd/cli.c b/multipathd/cli.c
index 7eaac73..051624a 100644
--- a/multipathd/cli.c
+++ b/multipathd/cli.c
@@ -406,6 +406,7 @@ cli_init (void) {
add_handler(LIST+PATHS, NULL);
add_handler(LIST+PATHS+FMT, NULL);
+ add_handler(LIST+STATUS, NULL);
add_handler(LIST+MAPS, NULL);
add_handler(LIST+MAPS+STATUS, NULL);
add_handler(LIST+MAPS+STATS, NULL);
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index c84805a..415f865 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -224,6 +224,26 @@ cli_list_maps_topology (void * v, char ** reply, int * len, void * data)
}
int
+show_status (char ** r, int *len, struct vectors * vecs)
+{
+ char * c;
+ char * reply;
+
+ unsigned int maxlen = INITIAL_REPLY_LEN;
+ reply = MALLOC(maxlen);
+
+ if (!reply)
+ return 1;
+
+ c = reply;
+ c += snprint_status(c, reply + maxlen - c, vecs);
+
+ *r = reply;
+ *len = (int)(c - reply + 1);
+ return 0;
+}
+
+int
show_maps (char ** r, int *len, struct vectors * vecs, char * style)
{
int i;
@@ -270,6 +290,16 @@ cli_list_maps (void * v, char ** reply, int * len, void * data)
}
int
+cli_list_status (void * v, char ** reply, int * len, void * data)
+{
+ struct vectors * vecs = (struct vectors *)data;
+
+ condlog(3, "list status (operator)");
+
+ return show_status(reply, len, vecs);
+}
+
+int
cli_list_maps_status (void * v, char ** reply, int * len, void * data)
{
struct vectors * vecs = (struct vectors *)data;
diff --git a/multipathd/cli_handlers.h b/multipathd/cli_handlers.h
index a688481..cfc4b12 100644
--- a/multipathd/cli_handlers.h
+++ b/multipathd/cli_handlers.h
@@ -1,5 +1,6 @@
int cli_list_paths (void * v, char ** reply, int * len, void * data);
int cli_list_paths_fmt (void * v, char ** reply, int * len, void * data);
+int cli_list_status (void * v, char ** reply, int * len, void * data);
int cli_list_maps (void * v, char ** reply, int * len, void * data);
int cli_list_maps_status (void * v, char ** reply, int * len, void * data);
int cli_list_maps_stats (void * v, char ** reply, int * len, void * data);
diff --git a/multipathd/main.c b/multipathd/main.c
index 8d74cb9..e57a3e4 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -159,7 +159,8 @@ sync_map_state(struct multipath *mpp)
vector_foreach_slot (mpp->pg, pgp, i){
vector_foreach_slot (pgp->paths, pp, j){
- if (pp->state <= PATH_UNCHECKED)
+ if (pp->state == PATH_UNCHECKED ||
+ pp->state == PATH_WILD)
continue;
if ((pp->dmstate == PSTATE_FAILED ||
pp->dmstate == PSTATE_UNDEF) &&
@@ -693,6 +694,7 @@ uxlsnrloop (void * ap)
set_handler_callback(LIST+PATHS, cli_list_paths);
set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt);
set_handler_callback(LIST+MAPS, cli_list_maps);
+ set_handler_callback(LIST+STATUS, cli_list_status);
set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status);
set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats);
set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology);
--
1.5.2.4

View File

@ -0,0 +1,204 @@
From 27ec49eca021f1cc85e66d55509f1e051a820bd4 Mon Sep 17 00:00:00 2001
From: Christophe Varoqui <christophe.varoqui@free.fr>
Date: Mon, 29 Sep 2008 01:37:02 +0200
Subject: [PATCH] [multipathd] add "show wildcards" cli command
The fact I had to look at the code to find the wildcards to use
in "show paths format ...", "show multipath format ..." and
"show pathgroup format ..." was a clear sign that more help was
necessary.
The "show wildcards" command outputs :
multipath format wildcards:
%n name
%w uuid
%d sysfs
%F failback
%Q queueing
%N paths
%r write_prot
%t dm-st
%S size
%f features
%h hwhandler
%A action
%0 path_faults
%1 switch_grp
%2 map_loads
%3 total_q_time
%4 q_timeouts
%s vend/prod/rev
path format wildcards:
%w uuid
%i hcil
%d dev
%D dev_t
%t dm_st
%T chk_st
%s vend/prod/rev
%C next_check
%p pri
%S size
pathgroup format wildcards:
%s selector
%p pri
%t dm_st
And for example, "show paths format foo:%d:%S:%i", outs
foo:dev:size:hcil
foo:sda:149G:2:0:0:0
---
libmultipath/print.c | 21 +++++++++++++++++++++
libmultipath/print.h | 1 +
multipathd/cli.c | 2 ++
multipathd/cli.h | 2 ++
multipathd/cli_handlers.c | 17 +++++++++++++++++
multipathd/cli_handlers.h | 1 +
multipathd/main.c | 1 +
7 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/libmultipath/print.c b/libmultipath/print.c
index 7411ccc..09b3579 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -436,8 +436,29 @@ struct pathgroup_data pgd[] = {
{'s', "selector", 0, snprint_pg_selector},
{'p', "pri", 0, snprint_pg_pri},
{'t', "dm_st", 0, snprint_pg_state},
+ {0, NULL, 0 , NULL}
};
+int
+snprint_wildcards (char * buff, int len)
+{
+ int i, fwd = 0;
+
+ fwd += snprintf(buff + fwd, len - fwd, "multipath format wildcards:\n");
+ for (i = 0; mpd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ mpd[i].wildcard, mpd[i].header);
+ fwd += snprintf(buff + fwd, len - fwd, "\npath format wildcards:\n");
+ for (i = 0; pd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ pd[i].wildcard, pd[i].header);
+ fwd += snprintf(buff + fwd, len - fwd, "\npathgroup format wildcards:\n");
+ for (i = 0; pgd[i].header; i++)
+ fwd += snprintf(buff + fwd, len - fwd, "%%%c %s\n",
+ pgd[i].wildcard, pgd[i].header);
+ return fwd;
+}
+
void
get_path_layout (vector pathvec, int header)
{
diff --git a/libmultipath/print.h b/libmultipath/print.h
index 1718c94..a8be408 100644
--- a/libmultipath/print.h
+++ b/libmultipath/print.h
@@ -44,6 +44,7 @@ int snprint_defaults (char *, int);
int snprint_blacklist (char *, int);
int snprint_blacklist_except (char *, int);
int snprint_blacklist_report (char *, int);
+int snprint_wildcards (char *, int);
int snprint_status (char *, int, struct vectors *);
int snprint_devices (char *, int, struct vectors *);
int snprint_hwtable (char *, int, vector);
diff --git a/multipathd/cli.c b/multipathd/cli.c
index 051624a..34ae07c 100644
--- a/multipathd/cli.c
+++ b/multipathd/cli.c
@@ -170,6 +170,7 @@ load_keys (void)
r += add_key(keys, "blacklist", BLACKLIST, 0);
r += add_key(keys, "devices", DEVICES, 0);
r += add_key(keys, "format", FMT, 1);
+ r += add_key(keys, "wildcards", WILDCARDS, 0);
if (r) {
free_keys(keys);
@@ -416,6 +417,7 @@ cli_init (void) {
add_handler(LIST+CONFIG, NULL);
add_handler(LIST+BLACKLIST, NULL);
add_handler(LIST+DEVICES, NULL);
+ add_handler(LIST+WILDCARDS, NULL);
add_handler(ADD+PATH, NULL);
add_handler(DEL+PATH, NULL);
add_handler(ADD+MAP, NULL);
diff --git a/multipathd/cli.h b/multipathd/cli.h
index 8c83eab..9932d96 100644
--- a/multipathd/cli.h
+++ b/multipathd/cli.h
@@ -20,6 +20,7 @@ enum {
__BLACKLIST,
__DEVICES,
__FMT,
+ __WILDCARDS,
};
#define LIST (1 << __LIST)
@@ -43,6 +44,7 @@ enum {
#define BLACKLIST (1 << __BLACKLIST)
#define DEVICES (1 << __DEVICES)
#define FMT (1 << __FMT)
+#define WILDCARDS (1 << __WILDCARDS)
#define INITIAL_REPLY_LEN 1000
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 415f865..36a4968 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -224,6 +224,23 @@ cli_list_maps_topology (void * v, char ** reply, int * len, void * data)
}
int
+cli_list_wildcards (void * v, char ** reply, int * len, void * data)
+{
+ char * c;
+
+ *reply = MALLOC(INITIAL_REPLY_LEN);
+
+ if (!reply)
+ return 1;
+
+ c = *reply;
+ c += snprint_wildcards(c, INITIAL_REPLY_LEN);
+
+ *len = INITIAL_REPLY_LEN;
+ return 0;
+}
+
+int
show_status (char ** r, int *len, struct vectors * vecs)
{
char * c;
diff --git a/multipathd/cli_handlers.h b/multipathd/cli_handlers.h
index cfc4b12..703a925 100644
--- a/multipathd/cli_handlers.h
+++ b/multipathd/cli_handlers.h
@@ -9,6 +9,7 @@ int cli_list_maps_topology (void * v, char ** reply, int * len, void * data);
int cli_list_config (void * v, char ** reply, int * len, void * data);
int cli_list_blacklist (void * v, char ** reply, int * len, void * data);
int cli_list_devices (void * v, char ** reply, int * len, void * data);
+int cli_list_wildcards (void * v, char ** reply, int * len, void * data);
int cli_add_path (void * v, char ** reply, int * len, void * data);
int cli_del_path (void * v, char ** reply, int * len, void * data);
int cli_add_map (void * v, char ** reply, int * len, void * data);
diff --git a/multipathd/main.c b/multipathd/main.c
index e57a3e4..84fb5c4 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -703,6 +703,7 @@ uxlsnrloop (void * ap)
set_handler_callback(LIST+CONFIG, cli_list_config);
set_handler_callback(LIST+BLACKLIST, cli_list_blacklist);
set_handler_callback(LIST+DEVICES, cli_list_devices);
+ set_handler_callback(LIST+WILDCARDS, cli_list_wildcards);
set_handler_callback(ADD+PATH, cli_add_path);
set_handler_callback(DEL+PATH, cli_del_path);
set_handler_callback(ADD+MAP, cli_add_map);
--
1.5.2.4

View File

@ -0,0 +1,123 @@
From 244454da2d4f3cb5d197a6b0e6fc2b4c8d72d08c Mon Sep 17 00:00:00 2001
From: Christophe Varoqui <christophe.varoqui@free.fr>
Date: Mon, 29 Sep 2008 00:44:46 +0200
Subject: [PATCH] [libmultipath] fixes for "show paths format"
o undue 1-char rollback when encountering unknown wildcard
o fix segfault when format starts with an unknown wildard
o continue parsing the format after an unknown wildcard
---
libmultipath/print.c | 33 +++++++++++++--------------------
1 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/libmultipath/print.c b/libmultipath/print.c
index 459b973..7411ccc 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -28,6 +28,9 @@
#define NOPAD s = c
#define PAD(x) while ((int)(c - s) < (x) && (c < (line + len - 1))) \
*c++ = ' '; s = c
+#define ENDLINE \
+ if (c > line) \
+ line[c - line - 1] = '\n'
#define PRINT(var, size, format, args...) \
fwd = snprintf(var, size, format, ##args); \
c += (fwd >= size) ? size : fwd;
@@ -532,15 +535,13 @@ snprint_multipath_header (char * line, int len, char * format)
f++;
if (!(data = mpd_lookup(*f)))
- break; /* unknown wildcard */
+ continue; /* unknown wildcard */
PRINT(c, TAIL, data->header);
PAD(data->width);
} while (*f++);
- line[c - line - 1] = '\n';
- line[c - line] = '\0';
-
+ ENDLINE;
return (c - line);
}
@@ -567,7 +568,7 @@ snprint_multipath (char * line, int len, char * format,
f++;
if (!(data = mpd_lookup(*f)))
- break;
+ continue;
data->snprint(buff, MAX_FIELD_LEN, mpp);
PRINT(c, TAIL, buff);
@@ -575,9 +576,7 @@ snprint_multipath (char * line, int len, char * format,
buff[0] = '\0';
} while (*f++);
- line[c - line - 1] = '\n';
- line[c - line] = '\0';
-
+ ENDLINE;
return (c - line);
}
@@ -602,15 +601,13 @@ snprint_path_header (char * line, int len, char * format)
f++;
if (!(data = pd_lookup(*f)))
- break; /* unknown wildcard */
+ continue; /* unknown wildcard */
PRINT(c, TAIL, data->header);
PAD(data->width);
} while (*f++);
- line[c - line - 1] = '\n';
- line[c - line] = '\0';
-
+ ENDLINE;
return (c - line);
}
@@ -637,16 +634,14 @@ snprint_path (char * line, int len, char * format,
f++;
if (!(data = pd_lookup(*f)))
- break;
+ continue;
data->snprint(buff, MAX_FIELD_LEN, pp);
PRINT(c, TAIL, buff);
PAD(data->width);
} while (*f++);
- line[c - line - 1] = '\n';
- line[c - line] = '\0';
-
+ ENDLINE;
return (c - line);
}
@@ -673,16 +668,14 @@ snprint_pathgroup (char * line, int len, char * format,
f++;
if (!(data = pgd_lookup(*f)))
- break;
+ continue;
data->snprint(buff, MAX_FIELD_LEN, pgp);
PRINT(c, TAIL, buff);
PAD(data->width);
} while (*f++);
- line[c - line - 1] = '\n';
- line[c - line] = '\0';
-
+ ENDLINE;
return (c - line);
}
--
1.5.2.4

View File

@ -0,0 +1,28 @@
From 3cf5b5aaa64e673364e8758640e5d5434425235b Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 9 Oct 2008 12:53:38 +0200
Subject: [PATCH] fopen returns NULL on failure, not -1
References: 432598
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
libmultipath/discovery.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index e1a67ac..a5ae8aa 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -237,7 +237,7 @@ devt2devname (char *devname, char *devt)
return 1;
}
- if ((fd = fopen("/proc/partitions", "r")) < 0) {
+ if (!(fd = fopen("/proc/partitions", "r"))) {
condlog(0, "Cannot open /proc/partitions");
return 1;
}
--
1.5.2.4

View File

@ -0,0 +1,26 @@
Subject: Add device-handler modules to mkinitrd script
From: Hannes Reinecke <hare@suse.de>
Date: Mon Oct 27 14:39:59 2008 +0100:
Git: 9ac06d484adb369c1848f5793cf36ab681899ef7
The mkinitrd boot script still tries to include the obsolete
device-mapper hardware handler modules. Update it to include
the SCSI device-handler modules.
References: 431877
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/multipath/boot-multipath.sh b/multipath/boot-multipath.sh
index a946785..ae11a26 100755
--- a/multipath/boot-multipath.sh
+++ b/multipath/boot-multipath.sh
@@ -4,7 +4,7 @@
#%provides: dmroot
#%programs: /sbin/multipath /lib/multipath/*
#%if: "$root_mpath"
-#%modules: dm-multipath dm-round-robin dm-emc dm-hp_sw dm-rdac
+#%modules: dm-multipath dm-round-robin scsi-dh-emc scsi-dh-hp_sw scsi-dh-rdac scsi-dh-alua
#
##### Multipath
##

View File

@ -0,0 +1,27 @@
From 669b5c11d8c82252f9697e35d183a0c840386261 Mon Sep 17 00:00:00 2001
From: Dave Wysochanski <dwysocha@redhat.com>
Date: Sun, 28 Sep 2008 22:32:29 +0200
Subject: [PATCH] [lib] Increase bindings file lock timeout to avoid failure of user_friendly_names
On setups with a large number of paths / multipath maps, contention for
the advisory lock on the bindings file may take longer than 3 seconds,
and some multipath processes may create maps based on WWID despite having
user_friendly_names set. Increasing the timeout is a simple fix that
gets us a bit further.
---
libmultipath/alias.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libmultipath/alias.h b/libmultipath/alias.h
index 3d64b9b..fe1191b 100644
--- a/libmultipath/alias.h
+++ b/libmultipath/alias.h
@@ -1,4 +1,4 @@
-#define BINDINGS_FILE_TIMEOUT 3
+#define BINDINGS_FILE_TIMEOUT 30
#define BINDINGS_FILE_HEADER \
"# Multipath bindings, Version : 1.0\n" \
"# NOTE: this file is automatically maintained by the multipath program.\n" \
--
1.5.2.4

View File

@ -0,0 +1,31 @@
From 18903014d3e6402909e709fedaf669d2a55c1490 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 21 Oct 2008 10:22:16 +0200
Subject: [PATCH] Increase buffer size in find_loop_by_file()
find_loop_by_file() uses an internal buffer of 20 chars, which is compared
to a buffer of the size of 64 chars. Not good.
References: 436428
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
kpartx/lopart.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index b18d6fa..be483da 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -105,7 +105,7 @@ is_loop_device (const char *device)
extern char *
find_loop_by_file (const char * filename)
{
- char dev[20];
+ char dev[64];
char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
int i, j, fd;
struct stat statbuf;
--
1.5.2.4

View File

@ -0,0 +1,56 @@
From 67f0f96ae532f8fda862576fba6f718809ade128 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 14 Oct 2008 08:38:29 +0200
Subject: [PATCH] kpartx -l does not remove it's loop device
When doing a kpartx -l it does not remove it's loop device when done.
The appended patch to multipath-tools could fix this.
References: 417266
Signed-off-by: Philipp Zimmer <pzimmer@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
kpartx/kpartx.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
index d1ba87c..43dcd13 100644
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
@@ -198,6 +198,7 @@ main(int argc, char **argv){
char *mapname = NULL;
int loopro = 0;
int hotplug = 0;
+ int loopcreated = 0;
struct stat buf;
initpts();
@@ -292,6 +293,7 @@ main(int argc, char **argv){
fprintf(stderr, "can't set up loop\n");
exit (1);
}
+ loopcreated = 1;
}
device = loopdev;
}
@@ -394,6 +396,15 @@ main(int argc, char **argv){
break;
}
+ if (loopcreated && S_ISREG (buf.st_mode)) {
+ if (del_loop(device)) {
+ if (verbose)
+ printf("can't del loop : %s\n",
+ device);
+ exit(1);
+ }
+ printf("loop deleted : %s\n", device);
+ }
break;
case DELETE:
--
1.5.2.4

View File

@ -0,0 +1,51 @@
From 375c38b4f4aa88fddd6106e4f2722e120fc1dac4 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 15 Oct 2008 13:44:00 +0200
Subject: [PATCH] Missing fixes for libprio ontap.c
The ontap.c libprio source file available on SLES10 SP2 has a few
deviations from the corresponding pp_ontap.c source file in the
path_priority directory.
References: 426975
Signed-off-by: Martin George <marting@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
libmultipath/prioritizers/ontap.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libmultipath/prioritizers/ontap.c b/libmultipath/prioritizers/ontap.c
index 0a629bc..1200114 100644
--- a/libmultipath/prioritizers/ontap.c
+++ b/libmultipath/prioritizers/ontap.c
@@ -27,7 +27,7 @@
#define INQUIRY_CMDLEN 6
#define DEFAULT_PRIOVAL 10
#define RESULTS_MAX 256
-#define SG_TIMEOUT 30000
+#define SG_TIMEOUT 60000
#define pp_ontap_log(prio, fmt, args...) \
condlog(prio, "%s: ontap prio: " fmt, dev, ##args)
@@ -194,7 +194,7 @@ static int ontap_prio(const char *dev, int fd)
memset(&results, 0, sizeof (results));
rc = send_gva(dev, fd, 0x41, results, &results_size);
- if (rc == 0) {
+ if (rc >= 0) {
tot_len = results[0] << 24 | results[1] << 16 |
results[2] << 8 | results[3];
if (tot_len <= 8) {
@@ -214,6 +214,8 @@ static int ontap_prio(const char *dev, int fd)
is_iscsi_hardware = 1;
goto prio_select;
}
+ } else {
+ return 0;
}
try_fcp_proxy:
--
1.5.2.4

View File

@ -0,0 +1,110 @@
From 965522c700ea307029789a1485242835132cea77 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 14 Oct 2008 08:21:02 +0200
Subject: [PATCH] Read the verbosity level from multipath.conf configuration file
With this patch, multipathd can read the verbosity level from
the multipath.conf configuration file.
For example:
verbosity 5
References: 388284
Signed-off-by: Ritesh Raj Sarraf <rsarraf@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
libmultipath/config.c | 2 +-
libmultipath/defaults.h | 1 +
libmultipath/dict.c | 20 ++++++++++++++++++++
multipath/multipath.conf.5 | 5 +++++
4 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 14bece1..d2585ed 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -423,7 +423,7 @@ load_config (char * file)
* internal defaults
*/
if (!conf->verbosity)
- conf->verbosity = 2;
+ conf->verbosity = DEFAULT_VERBOSITY;
conf->dev_type = DEV_NONE;
conf->minio = 1000;
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index 87b155e..a943673 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -11,6 +11,7 @@
#define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF
#define DEFAULT_PGTIMEOUT -PGTIMEOUT_NONE
#define DEFAULT_USER_FRIENDLY_NAMES 0
+#define DEFAULT_VERBOSITY 2
#define DEFAULT_CHECKINT 5
#define MAX_CHECKINT(a) (a << 2)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index a5a294e..5794b11 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -33,6 +33,17 @@ polling_interval_handler(vector strvec)
}
static int
+verbosity_handler(vector strvec)
+{
+ char * buff;
+
+ buff = VECTOR_SLOT(strvec, 1);
+ conf->verbosity = atoi(buff);
+
+ return 0;
+}
+
+static int
udev_dir_handler(vector strvec)
{
conf->udev_dir = set_value(strvec);
@@ -1327,6 +1338,14 @@ snprint_def_polling_interval (char * buff, int len, void * data)
}
static int
+snprint_def_verbosity (char * buff, int len, void * data)
+{
+ if (conf->checkint == DEFAULT_VERBOSITY)
+ return 0;
+ return snprintf(buff, len, "%i", conf->verbosity);
+}
+
+static int
snprint_def_udev_dir (char * buff, int len, void * data)
{
if (!conf->udev_dir)
@@ -1572,6 +1591,7 @@ void
init_keywords(void)
{
install_keyword_root("defaults", NULL);
+ install_keyword("verbosity", &verbosity_handler, &snprint_def_verbosity);
install_keyword("polling_interval", &polling_interval_handler, &snprint_def_polling_interval);
install_keyword("udev_dir", &udev_dir_handler, &snprint_def_udev_dir);
install_keyword("multipath_dir", &multipath_dir_handler, &snprint_def_multipath_dir);
diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 90ef588..d3c37c8 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -74,6 +74,11 @@ interval between two path checks in seconds; default is
directory where udev creates its device nodes; default is
.I /dev
.TP
+.B verbosity
+default verbosity. Higher values increase the verbosity level. Valid
+levels are between 0 and 6; default is 2.
+.I /dev
+.TP
.B selector
The default path selector algorithm to use; they are offered by the
kernel multipath target. The only currently implemented is
--
1.5.2.4

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Mon Oct 27 10:30:18 CET 2008 - hare@suse.de
- Patches from mainline:
* Increase bindings file lock timeout
* Fixes for 'show paths format'
* Add 'show wildcards' cli cmd
* Add support for IBM storage devices
- fopen() returns NULL on failure (bnc#432598)
- Read verbosity level from configuration file (bnc#388284)
- kpartx -l does not remove it's loop device (bnc#417266)
- Missing fixes for libprio ontap.c (bnc#426975)
- Increase buffer size in find_loop_by_file (bnc#436428)
- Include SCSI device handler modules for initrd (bnc#431877)
-------------------------------------------------------------------
Fri Sep 26 16:26:55 CEST 2008 - hare@suse.de

View File

@ -27,7 +27,7 @@ Requires: device-mapper kpartx
PreReq: %insserv_prereq %fillup_prereq coreutils grep diffutils
AutoReqProv: on
Version: 0.4.8
Release: 21
Release: 22
Summary: Tools to Manage Multipathed Devices with the device-mapper
Source: multipath-tools-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -36,6 +36,18 @@ Patch1: %{name}-sles11-alpha1-update
Patch2: %{name}-sles11-alpha3-update
Patch3: %{name}-check-get_inq-return-values
Patch4: %{name}-implement-map-resize
Patch5: %{name}-add-show-status-cmd
Patch6: %{name}-add-compellent-hwtable-entry
Patch7: %{name}-increase-bindings-file-lock-timeout
Patch8: %{name}-fixes-for-show-paths-format
Patch9: %{name}-add-show-wildcards-cmd
Patch10: %{name}-fopen-returns-NULL
Patch11: %{name}-read-verbosity-level-from-conf
Patch12: %{name}-kpartx-doesnt-remove-loop-device
Patch13: %{name}-missing-fixes-for-ontap
Patch14: %{name}-add-IBM-storage-to-hwtable
Patch15: %{name}-increase-loop-buffer-size
Patch16: %{name}-include-device-handler-modules
%description
This package provides the tools to manage multipathed devices by
@ -81,6 +93,18 @@ Authors:
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%build
make OPTFLAGS="$RPM_OPT_FLAGS"
@ -142,10 +166,22 @@ exit 0
%{_mandir}/man8/kpartx.8*
%changelog
* Mon Oct 27 2008 hare@suse.de
- Patches from mainline:
* Increase bindings file lock timeout
* Fixes for 'show paths format'
* Add 'show wildcards' cli cmd
* Add support for IBM storage devices
- fopen() returns NULL on failure (bnc#432598)
- Read verbosity level from configuration file (bnc#388284)
- kpartx -l does not remove it's loop device (bnc#417266)
- Missing fixes for libprio ontap.c (bnc#426975)
- Increase buffer size in find_loop_by_file (bnc#436428)
- Include SCSI device handler modules for initrd (bnc#431877)
* Fri Sep 26 2008 hare@suse.de
- Implement map resize (FATE#302007)
- Handle cciss devices correctly (bnc#419123)
* Thu Sep 25 2008 ro@suse.de
* Wed Sep 24 2008 ro@suse.de
- use udevadm info instead of udevinfo
* Wed Sep 03 2008 hare@suse.de
- Merge in fixes from upstream: