SOURCES: multipath-tools-branch.diff - updated to 01.01.2009 GIT
baggins
baggins at pld-linux.org
Thu Jan 1 21:12:29 CET 2009
Author: baggins Date: Thu Jan 1 20:12:29 2009 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated to 01.01.2009 GIT
---- Files affected:
SOURCES:
multipath-tools-branch.diff (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/multipath-tools-branch.diff
diff -u SOURCES/multipath-tools-branch.diff:1.2 SOURCES/multipath-tools-branch.diff:1.3
--- SOURCES/multipath-tools-branch.diff:1.2 Tue Nov 25 23:29:28 2008
+++ SOURCES/multipath-tools-branch.diff Thu Jan 1 21:12:23 2009
@@ -728,6 +728,19 @@
int container;
int major;
int minor;
+diff --git a/kpartx/lopart.c b/kpartx/lopart.c
+index b18d6fa..33f312b 100644
+--- a/kpartx/lopart.c
++++ b/kpartx/lopart.c
+@@ -30,7 +30,7 @@
+ #if defined(__hppa__) || defined(__powerpc64__) || defined (__alpha__) \
+ || defined (__x86_64__)
+ typedef unsigned long __kernel_old_dev_t;
+-#elif defined(__powerpc__) || defined(__ia64__)
++#elif defined(__powerpc__) || defined(__ia64__) || (defined(__sparc__) && defined (__arch64__))
+ typedef unsigned int __kernel_old_dev_t;
+ #else
+ typedef unsigned short __kernel_old_dev_t;
diff --git a/libcheckers/Makefile b/libcheckers/Makefile
deleted file mode 100644
index 6340a68..0000000
@@ -2130,7 +2143,7 @@
- rm -f core *.a *.o *.gz
+ rm -f core *.a *.o *.gz *.so
diff --git a/libmultipath/alias.c b/libmultipath/alias.c
-index ca434fe..8473187 100644
+index ca434fe..95506b4 100644
--- a/libmultipath/alias.c
+++ b/libmultipath/alias.c
@@ -86,7 +86,7 @@ lock_bindings_file(int fd)
@@ -2207,7 +2220,7 @@
static int
lookup_binding(FILE *f, char *map_wwid, char **map_alias)
-@@ -200,7 +240,8 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias)
+@@ -200,9 +240,10 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias)
alias = strtok(buf, " \t");
if (!alias) /* blank line */
continue;
@@ -2215,8 +2228,11 @@
+ curr_id = scan_devname(alias);
+ if (curr_id >= id)
id = curr_id + 1;
- wwid = strtok(NULL, " \t");
+- wwid = strtok(NULL, " \t");
++ wwid = strtok(NULL, "");
if (!wwid){
+ condlog(3,
+ "Ignoring malformed line %u in bindings file",
@@ -221,7 +262,7 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias)
}
condlog(3, "No matching wwid [%s] in bindings file.", map_wwid);
@@ -4531,7 +4547,7 @@
vector keywords;
vector mptable;
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
-index 3cd6041..285a8a2 100644
+index 3cd6041..83ee0ae 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -14,8 +14,7 @@
@@ -4552,7 +4568,19 @@
extern int
setup_map (struct multipath * mpp)
-@@ -130,7 +130,7 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp)
+@@ -50,6 +50,11 @@ setup_map (struct multipath * mpp)
+ }
+
+ /*
++ * free features, selector, and hwhandler properties if they are being reused
++ */
++ free_multipath_attributes(mpp);
++
++ /*
+ * properties selectors
+ */
+ select_pgfailback(mpp);
+@@ -130,7 +135,7 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp)
}
static void
@@ -4561,7 +4589,7 @@
{
struct multipath * cmpp;
-@@ -154,7 +154,7 @@ select_action (struct multipath * mpp, vector curmp)
+@@ -154,7 +159,7 @@ select_action (struct multipath * mpp, vector curmp)
if (!find_mp_by_wwid(curmp, mpp->wwid)) {
condlog(2, "%s: remove (wwid changed)", cmpp->alias);
@@ -4570,7 +4598,7 @@
strncat(cmpp->wwid, mpp->wwid, WWID_SIZE);
drop_multipath(curmp, cmpp->wwid, KEEP_PATHS);
mpp->action = ACT_CREATE;
-@@ -169,6 +169,12 @@ select_action (struct multipath * mpp, vector curmp)
+@@ -169,6 +174,12 @@ select_action (struct multipath * mpp, vector curmp)
mpp->alias);
return;
}
@@ -4583,7 +4611,7 @@
if (cmpp->size != mpp->size) {
mpp->action = ACT_RELOAD;
condlog(3, "%s: set ACT_RELOAD (size change)",
-@@ -183,14 +189,14 @@ select_action (struct multipath * mpp, vector curmp)
+@@ -183,14 +194,14 @@ select_action (struct multipath * mpp, vector curmp)
mpp->alias);
return;
}
@@ -4600,7 +4628,7 @@
strlen(mpp->selector))) {
mpp->action = ACT_RELOAD;
condlog(3, "%s: set ACT_RELOAD (selector change)",
-@@ -203,7 +209,7 @@ select_action (struct multipath * mpp, vector curmp)
+@@ -203,7 +214,7 @@ select_action (struct multipath * mpp, vector curmp)
mpp->alias, cmpp->minio, mpp->minio);
return;
}
@@ -4609,7 +4637,7 @@
mpp->action = ACT_RELOAD;
condlog(3, "%s: set ACT_RELOAD (path group number change)",
mpp->alias);
-@@ -330,28 +336,19 @@ domap (struct multipath * mpp)
+@@ -330,28 +341,19 @@ domap (struct multipath * mpp)
break;
}
@@ -4645,7 +4673,7 @@
break;
case ACT_RENAME:
-@@ -364,18 +361,24 @@ domap (struct multipath * mpp)
+@@ -364,18 +366,24 @@ domap (struct multipath * mpp)
if (r) {
/*
@@ -4680,7 +4708,7 @@
return DOMAP_OK;
}
return DOMAP_FAIL;
-@@ -404,7 +407,7 @@ deadmap (struct multipath * mpp)
+@@ -404,7 +412,7 @@ deadmap (struct multipath * mpp)
}
extern int
@@ -4689,7 +4717,7 @@
{
int r = 1;
int k, i;
-@@ -417,6 +420,11 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -417,6 +425,11 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
memset(empty_buff, 0, WWID_SIZE);
@@ -4701,7 +4729,7 @@
vector_foreach_slot (pathvec, pp1, k) {
/* skip this path for some reason */
-@@ -440,7 +448,8 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -440,7 +453,8 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
/*
* at this point, we know we really got a new mp
*/
@@ -4711,7 +4739,7 @@
return 1;
if (pp1->priority == PRIO_UNDEF)
-@@ -448,7 +457,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -448,7 +462,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
if (!mpp->paths) {
condlog(0, "%s: skip coalesce (no paths)", mpp->alias);
@@ -4720,7 +4748,7 @@
continue;
}
-@@ -476,12 +485,12 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -476,12 +490,12 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
verify_paths(mpp, vecs, NULL);
if (setup_map(mpp)) {
@@ -4735,7 +4763,7 @@
r = domap(mpp);
-@@ -490,7 +499,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -490,7 +504,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
"for create/reload map",
mpp->alias, r);
if (r == DOMAP_FAIL) {
@@ -4744,7 +4772,7 @@
continue;
} else /* if (r == DOMAP_RETRY) */
return r;
-@@ -518,7 +527,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -518,7 +532,7 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
vector_set_slot(newmp, mpp);
}
else
@@ -4753,7 +4781,7 @@
}
}
/*
-@@ -538,9 +547,9 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
+@@ -538,9 +552,9 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
if ((j = find_slot(newmp, (void *)mpp)) != -1)
vector_del_slot(newmp, j);
@@ -4870,7 +4898,7 @@
#define DEFAULT_SOCKET "/var/run/multipathd.sock"
#define DEFAULT_CONFIGFILE "/etc/multipath.conf"
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
-index d6991ba..70e10c2 100644
+index d6991ba..78204ff 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -14,8 +14,7 @@
@@ -4965,7 +4993,12 @@
if (uuid){
prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(uuid) + 1);
if (!prefixed_uuid) {
-@@ -220,11 +215,59 @@ dm_addmap (int task, const char *name, const char *target,
+@@ -216,15 +211,63 @@ dm_addmap (int task, const char *name, const char *target,
+
+ freeout:
+ if (prefixed_uuid)
+- free(prefixed_uuid);
++ FREE(prefixed_uuid);
addout:
dm_task_destroy (dmt);
@@ -4994,14 +5027,14 @@
+#define ADDMAP_RW 0
+#define ADDMAP_RO 1
+
- extern int
--dm_map_present (char * str)
++extern int
+dm_addmap_create (const char *name, const char *params,
+ unsigned long long size, const char *uuid) {
+ return _dm_addmap_create(name, params, size, uuid, ADDMAP_RW);
+}
+
-+extern int
+ extern int
+-dm_map_present (char * str)
+dm_addmap_create_ro (const char *name, const char *params,
+ unsigned long long size, const char *uuid) {
+ return _dm_addmap_create(name, params, size, uuid, ADDMAP_RO);
@@ -5080,7 +5113,7 @@
int
dm_get_minor (char * mapname)
{
-@@ -473,16 +516,16 @@ out:
+@@ -473,17 +516,17 @@ out:
dm_task_destroy(dmt);
return r;
}
@@ -5096,10 +5129,12 @@
return 0;
- if (dm_type(mapname, type) <= 0)
+- return 1;
+ if (dm_type(mapname, TGT_MPATH) <= 0)
- return 1;
++ return 0; /* nothing to do */
if (dm_remove_partmaps(mapname))
+ return 1;
@@ -491,7 +534,7 @@ dm_flush_map (char * mapname, char * type)
if (dm_get_opencount(mapname)) {
condlog(2, "%s: map in use", mapname);
@@ -5123,7 +5158,7 @@
do {
- r += dm_flush_map(names->name, type);
-+ r += dm_flush_map(names->name);
++ r |= dm_flush_map(names->name);
next = names->next;
names = (void *) names + next;
} while (next);
@@ -5165,7 +5200,7 @@
} while (next);
r = 0;
-@@ -717,7 +760,7 @@ out:
+@@ -717,32 +760,34 @@ out:
}
extern int
@@ -5174,16 +5209,42 @@
{
vector vec;
struct multipath *mpp;
-@@ -728,7 +771,7 @@ dm_get_name(char *uuid, char *type, char *name)
+- int i;
++ int i, rc = 0;
+
+ vec = vector_alloc();
+
if (!vec)
return 0;
- if (dm_get_maps(vec, type)) {
+- vector_free(vec);
+- return 0;
+ if (dm_get_maps(vec)) {
- vector_free(vec);
- return 0;
++ goto out;
+ }
+
+ vector_foreach_slot(vec, mpp, i) {
+ if (!strcmp(uuid, mpp->wwid)) {
+- vector_free(vec);
+ strcpy(name, mpp->alias);
+- return 1;
++ rc=1;
++ break;
+ }
}
-@@ -827,7 +870,7 @@ bad:
+-
++out:
++ vector_foreach_slot(vec, mpp, i) {
++ free_multipath(mpp, KEEP_PATHS);
++ }
+ vector_free(vec);
+- return 0;
++ return rc;
+ }
+
+ int
+@@ -827,7 +872,7 @@ bad:
}
int
@@ -5192,7 +5253,7 @@
{
struct dm_task *dmt;
struct dm_names *names;
-@@ -861,7 +904,7 @@ dm_remove_partmaps (char * mapname)
+@@ -861,7 +906,7 @@ dm_remove_partmaps (char * mapname)
/*
* if devmap target is "linear"
*/
@@ -5201,7 +5262,7 @@
/*
* and the multipath mapname and the part mapname start
-@@ -884,7 +927,7 @@ dm_remove_partmaps (char * mapname)
+@@ -884,7 +929,7 @@ dm_remove_partmaps (char * mapname)
*/
strstr(params, dev_t)
) {
@@ -5210,7 +5271,7 @@
* then it's a kpartx generated partition.
* remove it.
*/
-@@ -914,7 +957,7 @@ dm_get_info (char * mapname, struct dm_info ** dmi)
+@@ -914,7 +959,7 @@ dm_get_info (char * mapname, struct dm_info ** dmi)
{
int r = 1;
struct dm_task *dmt = NULL;
@@ -5219,7 +5280,7 @@
if (!mapname)
return 1;
-@@ -984,7 +1027,7 @@ dm_rename_partmaps (char * old, char * new)
+@@ -984,7 +1029,7 @@ dm_rename_partmaps (char * old, char * new)
/*
* if devmap target is "linear"
*/
@@ -5228,7 +5289,7 @@
/*
* and the multipath mapname and the part mapname start
-@@ -1002,7 +1045,7 @@ dm_rename_partmaps (char * old, char * new)
+@@ -1002,7 +1047,7 @@ dm_rename_partmaps (char * old, char * new)
*/
strstr(buff, dev_t)
) {
@@ -5237,7 +5298,7 @@
* then it's a kpartx generated partition.
* Rename it.
*/
-@@ -1040,7 +1083,7 @@ dm_rename (char * old, char * new)
+@@ -1040,7 +1085,7 @@ dm_rename (char * old, char * new)
if (!dm_task_set_newname(dmt, new))
goto out;
@@ -5840,7 +5901,7 @@
install_keyword("rr_weight", &hw_weight_handler, &snprint_hw_rr_weight);
install_keyword("no_path_retry", &hw_no_path_retry_handler, &snprint_hw_no_path_retry);
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
-index c842eb0..bbb9f9b 100644
+index c842eb0..9ae2b8f 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -11,8 +11,7 @@
@@ -5919,7 +5980,7 @@
static int
opennode (char * dev, int mode)
{
-@@ -244,11 +242,11 @@ devt2devname (char *devname, char *devt)
+@@ -244,18 +242,22 @@ devt2devname (char *devname, char *devt)
condlog(0, "Cannot open /proc/partitions");
return 1;
}
@@ -5933,7 +5994,27 @@
continue;
}
if (r != 3)
-@@ -280,62 +278,62 @@ int
+ continue;
+
+ if ((major == tmpmaj) && (minor == tmpmin)) {
+- sprintf(block_path, "/sys/block/%s", dev);
++ if (snprintf(block_path, FILE_NAME_SIZE, "/sys/block/%s", dev) >= FILE_NAME_SIZE) {
++ condlog(0, "device name %s is too long\n", dev);
++ fclose(fd);
++ return 1;
++ }
+ break;
+ }
+ }
+@@ -273,6 +275,7 @@ devt2devname (char *devname, char *devt)
+ condlog(0, "sysfs entry %s is not a directory\n", block_path);
+ return 1;
+ }
++ basename(block_path, devname);
+ return 0;
+ }
+
+@@ -280,62 +283,62 @@ int
do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op,
void *resp, int mx_resp_len, int noisy)
{
@@ -6043,7 +6124,7 @@
if (0 == do_inq(fd, 0, 1, 0x80, buff, MX_ALLOC_LEN, 0)) {
len = buff[3];
-@@ -347,7 +345,7 @@ get_serial (char * str, int maxlen, int fd)
+@@ -347,7 +350,7 @@ get_serial (char * str, int maxlen, int fd)
}
return 0;
}
@@ -6052,7 +6133,7 @@
}
static int
-@@ -361,10 +359,13 @@ get_inq (char * vendor, char * product, char * rev, int fd)
+@@ -361,10 +364,13 @@ get_inq (char * vendor, char * product, char * rev, int fd)
if (0 == do_inq(fd, 0, 0, 0, buff, MX_ALLOC_LEN, 0)) {
memcpy(vendor, buff + 8, 8);
vendor[8] = '\0';
@@ -6066,7 +6147,7 @@
return 0;
}
return 1;
-@@ -456,7 +457,7 @@ ccw_sysfs_pathinfo (struct path * pp, struct sysfs_device * parent)
+@@ -456,7 +462,7 @@ ccw_sysfs_pathinfo (struct path * pp, struct sysfs_device * parent)
/*
* host / bus / target / lun
@@ -6075,7 +6156,7 @@
basename(parent->devpath, attr_path);
pp->sg_id.lun = 0;
sscanf(attr_path, "%i.%i.%x",
-@@ -528,6 +529,35 @@ struct sysfs_device *sysfs_device_from_path(struct path *pp)
+@@ -528,6 +534,35 @@ struct sysfs_device *sysfs_device_from_path(struct path *pp)
return sysfs_device_get(sysdev);
}
@@ -6111,7 +6192,7 @@
extern int
sysfs_pathinfo(struct path * pp)
{
-@@ -546,6 +576,9 @@ sysfs_pathinfo(struct path * pp)
+@@ -546,6 +581,9 @@ sysfs_pathinfo(struct path * pp)
if (!parent)
parent = pp->sysdev;
@@ -6121,7 +6202,7 @@
condlog(3, "%s: subsystem = %s", pp->dev, parent->subsystem);
if (!strncmp(parent->subsystem, "scsi",4))
-@@ -615,10 +648,15 @@ get_state (struct path * pp)
+@@ -615,10 +653,15 @@ get_state (struct path * pp)
if (checker_init(c, &pp->mpp->mpcontext))
return 1;
}
@@ -6139,7 +6220,7 @@
pp->dev, checker_message(c));
return 0;
}
-@@ -626,27 +664,22 @@ get_state (struct path * pp)
+@@ -626,27 +669,22 @@ get_state (struct path * pp)
static int
get_prio (struct path * pp)
{
@@ -6179,7 +6260,7 @@
return 0;
}
-@@ -662,7 +695,7 @@ get_uid (struct path * pp)
+@@ -662,7 +700,7 @@ get_uid (struct path * pp)
condlog(0, "error formatting uid callout command");
memset(pp->wwid, 0, WWID_SIZE);
} else if (execute_program(buff, pp->wwid, WWID_SIZE)) {
@@ -6188,7 +6269,7 @@
memset(pp->wwid, 0, WWID_SIZE);
return 1;
}
-@@ -723,5 +756,6 @@ blank:
+@@ -723,5 +761,6 @@ blank:
*/
memset(pp->wwid, 0, WWID_SIZE);
pp->state = PATH_DOWN;
@@ -7241,8 +7322,24 @@
free_logarea();
-}
+}
+diff --git a/libmultipath/memory.c b/libmultipath/memory.c
+index 71dfe40..bd6ae5e 100644
+--- a/libmultipath/memory.c
++++ b/libmultipath/memory.c
+@@ -459,9 +459,8 @@ dbg_realloc(void *buffer, unsigned long size, char *file, char *function,
+ if (debug & 1)
+ printf("realloc [%3d:%3d] %p, %4ld %s %d %s -> %p %4ld %s %d %s\n",
+ i, number_alloc_list, alloc_list[i].ptr,
+- alloc_list[i].size, file, line, function, buf, size,
+- alloc_list[i].file, alloc_list[i].line,
+- alloc_list[i].func);
++ alloc_list[i].size, alloc_list[i].file, alloc_list[i].line, alloc_list[i].func,
++ buf, size, file, line, function);
+
+ alloc_list[i].ptr = buf;
+ alloc_list[i].size = size;
diff --git a/libmultipath/parser.c b/libmultipath/parser.c
-index f9c555e..070745d 100644
+index f9c555e..f1fdeb8 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -1,11 +1,11 @@
@@ -7288,20 +7385,30 @@
cp++;
/* Return if there is only white spaces */
-@@ -241,8 +241,10 @@ alloc_strvec(char *string)
+@@ -239,10 +239,20 @@ alloc_strvec(char *string)
+ in_string = 0;
+ else
in_string = 1;
++ } else if (!in_string && (*cp == '{' || *cp == '}')) {
++ token = MALLOC(2);
++ if (!token)
++ goto out;
++
++ *(token) = *cp;
++ *(token + 1) = '\0';
++ cp++;
} else {
- while ((in_string || !isspace((int) *cp)) && *cp
- != '\0' && *cp != '"')
+ while ((in_string ||
+ (!isspace((int) *cp) && isascii((int) *cp) &&
-+ *cp != '!' && *cp != '#')) &&
-+ *cp != '\0' && *cp != '"')
++ *cp != '!' && *cp != '#' && *cp != '{' &&
++ *cp != '}')) && *cp != '\0' && *cp != '"')
cp++;
strlen = cp - start;
token = MALLOC(strlen + 1);
-@@ -255,7 +257,8 @@ alloc_strvec(char *string)
+@@ -255,7 +265,8 @@ alloc_strvec(char *string)
}
vector_set_slot(strvec, token);
@@ -7311,7 +7418,7 @@
cp++;
if (*cp == '\0' || *cp == '!' || *cp == '#')
return strvec;
-@@ -447,7 +450,7 @@ process_stream(vector keywords)
+@@ -447,7 +458,7 @@ process_stream(vector keywords)
break;
}
}
@@ -7468,7 +7575,7 @@
}
diff --git a/libmultipath/print.c b/libmultipath/print.c
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/multipath-tools-branch.diff?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list