Hello community, here is the log from the commit of package multipath-tools for openSUSE:Factory checked in at 2014-06-30 21:43:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/multipath-tools (Old) and /work/SRC/openSUSE:Factory/.multipath-tools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "multipath-tools" Changes: -------- --- /work/SRC/openSUSE:Factory/multipath-tools/multipath-tools.changes 2014-06-19 13:19:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.multipath-tools.new/multipath-tools.changes 2014-06-30 21:43:20.000000000 +0200 @@ -1,0 +2,14 @@ +Tue Jun 24 09:45:57 CEST 2014 - hare@suse.de + +- Fixup race condition with udev (bnc#883878) +- Cleanup foreground operation handling in multipathd +- Fix some minor issues in path reordering code (bnc#870465) +- Patches from upstream: + * Use existing user friendly names if possible + * kpartx: fix extended partition size for >512b sectors + * Mismatch between allocation length and transfer length in + rdac prio + * Mismatch between allocation length and transfer length in + emc_clariion prio. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ multipath-tools-0.5.0-sles12.diff.bz2 ++++++ --- /var/tmp/diff_new_pack.JM7x81/_old 2014-06-30 21:43:21.000000000 +0200 +++ /var/tmp/diff_new_pack.JM7x81/_new 2014-06-30 21:43:21.000000000 +0200 @@ -110,6 +110,25 @@ int dm_addmap (int, const char *, const char *, const char *, uint64_t, int, const char *, int, mode_t, uid_t, gid_t, uint32_t *); int dm_map_present (char *); +diff --git a/kpartx/dos.c b/kpartx/dos.c +index 0e57f0e..90ad3bd 100644 +--- a/kpartx/dos.c ++++ b/kpartx/dos.c +@@ -101,8 +101,12 @@ read_dos_pt(int fd, struct slice all, struct slice *sp, int ns) { + break; + } + if (is_extended(p.sys_type)) { +- sp[i].size = sector_size_mul * 2; /* extended partitions only get two +- sectors mapped for LILO to install */ ++ /* extended partitions only get one or ++ two sectors mapped for LILO to install, ++ whichever is needed to have 1kb of space */ ++ if (sector_size_mul == 1) ++ sp[i].size = 2; ++ else sp[i].size = sector_size_mul; + n += read_extended_partition(fd, &p, i, sp+n, ns-n); + } + } diff --git a/kpartx/kpartx-compat.rules b/kpartx/kpartx-compat.rules new file mode 100644 index 0000000..3b94f92 @@ -380,6 +399,128 @@ endif OBJS = memory.o parser.o vector.o devmapper.o callout.o \ +diff --git a/libmultipath/alias.c b/libmultipath/alias.c +index ab15185..f1879c9 100644 +--- a/libmultipath/alias.c ++++ b/libmultipath/alias.c +@@ -67,7 +67,7 @@ scan_devname(char *alias, char *prefix) + return -1; + + if (strlen(alias) == strlen(prefix)) +- return -1; ++ return -1; + + if (strlen(alias) > strlen(prefix) + 7) + /* id of 'aaaaaaaa' overflows int */ +@@ -145,7 +145,7 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias, char *prefix) + } + + static int +-rlookup_binding(FILE *f, char *buff, char *map_alias) ++rlookup_binding(FILE *f, char *buff, char *map_alias, char *prefix) + { + char line[LINE_MAX]; + unsigned int line_nr = 0; +@@ -164,7 +164,7 @@ rlookup_binding(FILE *f, char *buff, char *map_alias) + alias = strtok(line, " \t"); + if (!alias) /* blank line */ + continue; +- curr_id = scan_devname(alias, NULL); /* TBD: Why this call? */ ++ curr_id = scan_devname(alias, prefix); + if (curr_id >= id) + id = curr_id + 1; + wwid = strtok(NULL, " \t"); +@@ -188,6 +188,11 @@ rlookup_binding(FILE *f, char *buff, char *map_alias) + } + } + condlog(3, "No matching alias [%s] in bindings file.", map_alias); ++ ++ /* Get the theoretical id for this map alias. ++ * Used by use_existing_alias ++ */ ++ id = scan_devname(map_alias, prefix); + return id; + } + +@@ -237,6 +242,59 @@ allocate_binding(int fd, char *wwid, int id, char *prefix) + } + + char * ++use_existing_alias (char *wwid, char *file, char *alias_old, ++ char *prefix, int bindings_read_only) ++{ ++ char *alias = NULL; ++ int id = 0; ++ int fd, can_write; ++ char buff[WWID_SIZE]; ++ FILE *f; ++ ++ fd = open_file(file, &can_write, BINDINGS_FILE_HEADER); ++ if (fd < 0) ++ return NULL; ++ ++ f = fdopen(fd, "r"); ++ if (!f) { ++ condlog(0, "cannot fdopen on bindings file descriptor"); ++ close(fd); ++ return NULL; ++ } ++ /* lookup the binding. if it exsists, the wwid will be in buff ++ * either way, id contains the id for the alias ++ */ ++ id = rlookup_binding(f , buff, alias_old, prefix); ++ if (id < 0) ++ goto out; ++ ++ if (strlen(buff) > 0) { ++ /* if buff is our wwid, it's already ++ * allocated correctly ++ */ ++ if (strcmp(buff, wwid) == 0) ++ alias = STRDUP(alias_old); ++ else { ++ alias = NULL; ++ condlog(0, "alias %s already bound to wwid %s, cannot reuse", ++ alias_old, buff); ++ } ++ goto out; ++ } ++ ++ /* allocate the existing alias in the bindings file */ ++ if (can_write && id && !bindings_read_only) { ++ alias = allocate_binding(fd, wwid, id, prefix); ++ condlog(0, "Allocated existing binding [%s] for WWID [%s]", ++ alias, wwid); ++ } ++ ++out: ++ fclose(f); ++ return alias; ++} ++ ++char * + get_user_friendly_alias(char *wwid, char *file, char *prefix, + int bindings_read_only) + { +@@ -305,7 +363,7 @@ get_user_friendly_wwid(char *alias, char *buff, char *file) + return -1; + } + +- rlookup_binding(f, buff, alias); ++ rlookup_binding(f, buff, alias, NULL); + if (!strlen(buff)) { + fclose(f); + return -1; +diff --git a/libmultipath/alias.h b/libmultipath/alias.h +index 8ddd0b5..9cb3e8f 100644 +--- a/libmultipath/alias.h ++++ b/libmultipath/alias.h +@@ -10,3 +10,5 @@ + char *get_user_friendly_alias(char *wwid, char *file, char *prefix, + int bindings_readonly); + int get_user_friendly_wwid(char *alias, char *buff, char *file); ++char *use_existing_alias (char *wwid, char *file, char *alias_old, ++ char *prefix, int bindings_read_only); diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c index 79ddcde..6420b4c 100644 --- a/libmultipath/blacklist.c @@ -511,7 +652,7 @@ struct hwentry { diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 8c09791..0ddd3d5 100644 +index 8c09791..c530391 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -39,6 +39,211 @@ @@ -535,7 +676,7 @@ + pp = VECTOR_SLOT(pgp->paths, 0); + + if (sysfs_get_host_adapter_name(pp, adapter_name1)) -+ return 1; ++ goto out; + /* create a new host adapter group + */ + agp = alloc_adaptergroup(); @@ -749,6 +890,15 @@ /* * transform the mp->pg vector of vectors of paths * into a mp->params strings to feed the device-mapper +@@ -308,7 +529,7 @@ lock_multipath (struct multipath * mpp, int lock) + if (!pgp->paths) + continue; + vector_foreach_slot(pgp->paths, pp, j) { +- if (lock && flock(pp->fd, LOCK_EX | LOCK_NB) && ++ if (lock && flock(pp->fd, LOCK_SH | LOCK_NB) && + errno == EWOULDBLOCK) + goto fail; + else if (!lock) @@ -389,13 +610,13 @@ domap (struct multipath * mpp, char * params) case ACT_RELOAD: r = dm_addmap_reload(mpp, params); @@ -989,7 +1139,7 @@ conf->fast_io_fail = MP_FAST_IO_FAIL_OFF; else if (sscanf(buff, "%d", &conf->fast_io_fail) != 1 || diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index 228ffd3..a37eb40 100644 +index 228ffd3..f42e59c 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -4,6 +4,7 @@ @@ -1194,7 +1344,7 @@ + "iscsi_host", host_name); + if (hostdev) { + value = udev_device_get_sysattr_value(hostdev, -+ "ip_address"); ++ "ipaddress"); + if (value) { + strncpy(ip_address, value, SLOT_NAME_SIZE); + udev_device_unref(hostdev); @@ -1432,11 +1582,99 @@ return; src = prio_lookup(dst->name); +diff --git a/libmultipath/prioritizers/emc.c b/libmultipath/prioritizers/emc.c +index 87e9a8d..91b3d90 100644 +--- a/libmultipath/prioritizers/emc.c ++++ b/libmultipath/prioritizers/emc.c +@@ -14,15 +14,15 @@ + + int emc_clariion_prio(const char *dev, int fd) + { +- unsigned char sense_buffer[256]; ++ unsigned char sense_buffer[128]; + unsigned char sb[128]; + unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC0, 0, +- sizeof(sb), 0}; ++ sizeof(sense_buffer), 0}; + struct sg_io_hdr io_hdr; + int ret = PRIO_UNDEF; + + memset(&io_hdr, 0, sizeof (struct sg_io_hdr)); +- memset(&sense_buffer, 0, 256); ++ memset(&sense_buffer, 0, 128); + io_hdr.interface_id = 'S'; + io_hdr.cmd_len = sizeof (inqCmdBlk); + io_hdr.mx_sb_len = sizeof (sb); +diff --git a/libmultipath/prioritizers/rdac.c b/libmultipath/prioritizers/rdac.c +index 441b3b0..2bf1443 100644 +--- a/libmultipath/prioritizers/rdac.c ++++ b/libmultipath/prioritizers/rdac.c +@@ -14,15 +14,15 @@ + + int rdac_prio(const char *dev, int fd) + { +- unsigned char sense_buffer[256]; ++ unsigned char sense_buffer[128]; + unsigned char sb[128]; + unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC9, 0, +- sizeof(sb), 0}; ++ sizeof(sense_buffer), 0}; + struct sg_io_hdr io_hdr; + int ret = 0; + + memset(&io_hdr, 0, sizeof (struct sg_io_hdr)); +- memset(sense_buffer, 0, 256); ++ memset(sense_buffer, 0, 128); + io_hdr.interface_id = 'S'; + io_hdr.cmd_len = sizeof (inqCmdBlk); + io_hdr.mx_sb_len = sizeof (sb); diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c -index 7b7944d..72001a8 100644 +index 7b7944d..8c95b5a 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c -@@ -363,30 +363,30 @@ out: +@@ -253,19 +253,31 @@ want_user_friendly_names(struct multipath * mp) + extern int + select_alias (struct multipath * mp) + { +- if (mp->mpe && mp->mpe->alias) ++ if (mp->mpe && mp->mpe->alias) { + mp->alias = STRDUP(mp->mpe->alias); +- else { +- mp->alias = NULL; +- if (want_user_friendly_names(mp)) { +- select_alias_prefix(mp); +- mp->alias = get_user_friendly_alias(mp->wwid, +- conf->bindings_file, mp->alias_prefix, conf->bindings_read_only); +- } +- if (mp->alias == NULL) +- mp->alias = STRDUP(mp->wwid); ++ goto out; + } + ++ mp->alias = NULL; ++ if (!want_user_friendly_names(mp)) ++ goto out; ++ ++ select_alias_prefix(mp); ++ ++ if (strlen(mp->alias_old) > 0) { ++ mp->alias = use_existing_alias(mp->wwid, conf->bindings_file, ++ mp->alias_old, mp->alias_prefix, ++ conf->bindings_read_only); ++ memset (mp->alias_old, 0, WWID_SIZE); ++ } ++ ++ if (mp->alias == NULL) ++ mp->alias = get_user_friendly_alias(mp->wwid, ++ conf->bindings_file, mp->alias_prefix, conf->bindings_read_only); ++out: ++ if (mp->alias == NULL) ++ mp->alias = STRDUP(mp->wwid); ++ + return mp->alias ? 0 : 1; + } + +@@ -363,30 +375,30 @@ out: extern int select_getuid (struct path * pp) { @@ -1582,7 +1820,7 @@ find_mp_by_minor (vector mpvec, int minor) { diff --git a/libmultipath/structs.h b/libmultipath/structs.h -index 64de06e..772a7d7 100644 +index 64de06e..af03edf 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -15,7 +15,8 @@ @@ -1591,7 +1829,7 @@ #define NAME_SIZE 512 - +#define HOST_NAME_LEN 8 -+#define SLOT_NAME_SIZE 32 ++#define SLOT_NAME_SIZE 40 #define SCSI_VENDOR_SIZE 9 #define SCSI_PRODUCT_SIZE 17 @@ -1632,7 +1870,7 @@ int store_pathgroup (vector pgvec, struct pathgroup * pgp); diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 76c7e02..411903c 100644 +index 76c7e02..0f22590 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -226,6 +226,12 @@ extract_hwe_from_path(struct multipath * mpp) @@ -1648,6 +1886,35 @@ condlog(3, "%s: vendor = %s", pp->dev, pp->vendor_id); condlog(3, "%s: product = %s", pp->dev, pp->product_id); condlog(3, "%s: rev = %s", pp->dev, pp->rev); +@@ -403,6 +409,20 @@ out: + return NULL; + } + ++static void ++find_existing_alias (struct multipath * mpp, ++ struct vectors *vecs) ++{ ++ struct multipath * mp; ++ int i; ++ ++ vector_foreach_slot (vecs->mpvec, mp, i) ++ if (strcmp(mp->wwid, mpp->wwid) == 0) { ++ strncpy(mpp->alias_old, mp->alias, WWID_SIZE); ++ return; ++ } ++} ++ + extern struct multipath * + add_map_with_path (struct vectors * vecs, + struct path * pp, int add_vec) +@@ -416,6 +436,7 @@ add_map_with_path (struct vectors * vecs, + mpp->hwe = pp->hwe; + + strcpy(mpp->wwid, pp->wwid); ++ find_existing_alias(mpp, vecs); + if (select_alias(mpp)) + goto out; + mpp->size = pp->size; diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index e5834f9..298a0ba 100644 --- a/libmultipath/sysfs.c @@ -2040,10 +2307,35 @@ int cli_list_daemon (void * v, char ** reply, int * len, void * data); int cli_list_maps (void * v, char ** reply, int * len, void * data); diff --git a/multipathd/main.c b/multipathd/main.c -index af93f32..8bd89d3 100644 +index af93f32..14ce939 100644 --- a/multipathd/main.c +++ b/multipathd/main.c -@@ -864,6 +864,7 @@ uxlsnrloop (void * ap) +@@ -449,6 +449,7 @@ ev_add_path (struct path * pp, struct vectors * vecs) + char params[PARAMS_SIZE] = {0}; + int retries = 3; + int start_waiter = 0; ++ int ret; + + /* + * need path UID to go any further +@@ -523,7 +524,15 @@ rescan: + /* + * reload the map for the multipath mapped device + */ +- if (domap(mpp, params) <= 0) { ++retry: ++ ret = domap(mpp, params); ++ if (ret <= 0) { ++ if (ret < 0 && retries-- > 0) { ++ condlog(0, "%s: retry domap for addition of new " ++ "path %s", mpp->alias, pp->dev); ++ sleep(1); ++ goto retry; ++ } + condlog(0, "%s: failed in domap for addition of new " + "path %s", mpp->alias, pp->dev); + /* +@@ -864,6 +873,7 @@ uxlsnrloop (void * ap) set_handler_callback(LIST+PATHS, cli_list_paths); set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt); @@ -2051,7 +2343,7 @@ set_handler_callback(LIST+MAPS, cli_list_maps); set_handler_callback(LIST+STATUS, cli_list_status); set_handler_callback(LIST+DAEMON, cli_list_daemon); -@@ -1118,9 +1119,6 @@ check_path (struct vectors * vecs, struct path * pp) +@@ -1118,9 +1128,6 @@ check_path (struct vectors * vecs, struct path * pp) int chkr_new_path_up = 0; int oldchkrstate = pp->chkrstate; @@ -2061,7 +2353,7 @@ if (pp->tick && --pp->tick) return 0; /* don't check this path yet */ -@@ -1663,7 +1661,7 @@ child (void * param) +@@ -1663,7 +1670,7 @@ child (void * param) udev = udev_new(); setup_thread_attr(&misc_attr, 64 * 1024, 1); @@ -2070,12 +2362,31 @@ setup_thread_attr(&waiter_attr, 32 * 1024, 1); if (logsink == 1) { -@@ -2000,9 +1998,10 @@ main (int argc, char *argv[]) +@@ -1939,6 +1946,7 @@ main (int argc, char *argv[]) + extern int optind; + int arg; + int err; ++ int foreground = 0; + + logsink = 1; + running_state = DAEMON_INIT; +@@ -1963,7 +1971,9 @@ main (int argc, char *argv[]) + while ((arg = getopt(argc, argv, ":dsv:k::")) != EOF ) { + switch(arg) { + case 'd': +- logsink = 0; ++ foreground = 1; ++ if (logsink > 0) ++ logsink = 0; + //debug=1; /* ### comment me out ### */ + break; + case 'v': +@@ -2000,9 +2010,10 @@ main (int argc, char *argv[]) exit(0); } - if (logsink < 1) -+ if (logsink < 1) { ++ if (foreground) { err = 0; - else + daemon_pid = getpid(); @@ -2279,10 +2590,24 @@ +fi diff --git a/rpm/multipath-tools.changes b/rpm/multipath-tools.changes new file mode 100644 -index 0000000..021329d +index 0000000..79e4c27 --- /dev/null +++ b/rpm/multipath-tools.changes -@@ -0,0 +1,1141 @@ +@@ -0,0 +1,1155 @@ ++------------------------------------------------------------------- ++Tue Jun 24 09:45:57 CEST 2014 - hare@suse.de ++ ++- Fixup race condition with udev (bnc#883878) ++- Cleanup foreground operation handling in multipathd ++- Fix some minor issues in path reordering code (bnc#870465) ++- Patches from upstream: ++ * Use existing user friendly names if possible ++ * kpartx: fix extended partition size for >512b sectors ++ * Mismatch between allocation length and transfer length in ++ rdac prio ++ * Mismatch between allocation length and transfer length in ++ emc_clariion prio. ++ +------------------------------------------------------------------- +Fri Jun 13 10:51:48 CEST 2014 - hare@suse.de + -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org