diff --git a/SOURCES/0133-RHBZ-1321019-wait-for-map-add.patch b/SOURCES/0133-RHBZ-1321019-wait-for-map-add.patch new file mode 100644 index 0000000..3ac3f77 --- /dev/null +++ b/SOURCES/0133-RHBZ-1321019-wait-for-map-add.patch @@ -0,0 +1,495 @@ +--- + libmultipath/config.c | 1 + libmultipath/config.h | 2 + libmultipath/configure.c | 4 + + libmultipath/defaults.h | 1 + libmultipath/dict.c | 25 +++++++++ + libmultipath/structs.h | 2 + multipath.conf.defaults | 1 + multipath/multipath.conf.5 | 8 +++ + multipathd/cli_handlers.c | 65 ++++++++++++++++++++---- + multipathd/main.c | 119 +++++++++++++++++++++++++++++++++++++++++++-- + multipathd/main.h | 1 + 11 files changed, 216 insertions(+), 13 deletions(-) + +Index: multipath-tools-130222/libmultipath/configure.c +=================================================================== +--- multipath-tools-130222.orig/libmultipath/configure.c ++++ multipath-tools-130222/libmultipath/configure.c +@@ -675,6 +675,10 @@ domap (struct multipath * mpp, char * pa + */ + if (mpp->action != ACT_CREATE) + mpp->action = ACT_NOTHING; ++ else { ++ mpp->wait_for_udev = 1; ++ mpp->uev_msg_tick = conf->uev_msg_delay; ++ } + } + dm_setgeometry(mpp); + return DOMAP_OK; +Index: multipath-tools-130222/libmultipath/structs.h +=================================================================== +--- multipath-tools-130222.orig/libmultipath/structs.h ++++ multipath-tools-130222/libmultipath/structs.h +@@ -217,6 +217,8 @@ struct multipath { + int bestpg; + int queuedio; + int action; ++ int wait_for_udev; ++ int uev_msg_tick; + int pgfailback; + int failback_tick; + int rr_weight; +Index: multipath-tools-130222/multipathd/cli_handlers.c +=================================================================== +--- multipath-tools-130222.orig/multipathd/cli_handlers.c ++++ multipath-tools-130222/multipathd/cli_handlers.c +@@ -548,6 +548,11 @@ cli_reload(void *v, char **reply, int *l + condlog(0, "%s: invalid map name. cannot reload", mapname); + return 1; + } ++ if (mpp->wait_for_udev) { ++ condlog(2, "%s: device not fully created, failing reload", ++ mpp->alias); ++ return 1; ++ } + + return reload_map(vecs, mpp, 0); + } +@@ -592,6 +597,12 @@ cli_resize(void *v, char **reply, int *l + return 1; + } + ++ if (mpp->wait_for_udev) { ++ condlog(2, "%s: device not fully created, failing resize", ++ mpp->alias); ++ return 1; ++ } ++ + pgp = VECTOR_SLOT(mpp->pg, 0); + + if (!pgp){ +@@ -756,6 +767,12 @@ cli_reconfigure(void * v, char ** reply, + { + struct vectors * vecs = (struct vectors *)data; + ++ if (need_to_delay_reconfig(vecs)) { ++ conf->delayed_reconfig = 1; ++ condlog(2, "delaying reconfigure (operator)"); ++ return 0; ++ } ++ + condlog(2, "reconfigure (operator)"); + + return reconfigure(vecs); +@@ -766,17 +783,25 @@ cli_suspend(void * v, char ** reply, int + { + struct vectors * vecs = (struct vectors *)data; + char * param = get_keyparam(v, MAP); +- int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0); ++ int r; ++ struct multipath * mpp; + + param = convert_dev(param, 0); +- condlog(2, "%s: suspend (operator)", param); ++ mpp = find_mp_by_alias(vecs->mpvec, param); ++ if (!mpp) ++ return 1; + +- if (!r) /* error */ ++ if (mpp->wait_for_udev) { ++ condlog(2, "%s: device not fully created, failing suspend", ++ mpp->alias); + return 1; ++ } + +- struct multipath * mpp = find_mp_by_alias(vecs->mpvec, param); ++ r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0); + +- if (!mpp) ++ condlog(2, "%s: suspend (operator)", param); ++ ++ if (!r) /* error */ + return 1; + + dm_get_info(param, &mpp->dmi); +@@ -788,17 +813,25 @@ cli_resume(void * v, char ** reply, int + { + struct vectors * vecs = (struct vectors *)data; + char * param = get_keyparam(v, MAP); +- int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); ++ int r; ++ struct multipath * mpp; + + param = convert_dev(param, 0); +- condlog(2, "%s: resume (operator)", param); ++ mpp = find_mp_by_alias(vecs->mpvec, param); ++ if (!mpp) ++ return 1; + +- if (!r) /* error */ ++ if (mpp->wait_for_udev) { ++ condlog(2, "%s: device not fully created, failing resume", ++ mpp->alias); + return 1; ++ } + +- struct multipath * mpp = find_mp_by_alias(vecs->mpvec, param); ++ r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0); + +- if (!mpp) ++ condlog(2, "%s: resume (operator)", param); ++ ++ if (!r) /* error */ + return 1; + + dm_get_info(param, &mpp->dmi); +@@ -831,9 +864,21 @@ cli_reinstate(void * v, char ** reply, i + int + cli_reassign (void * v, char ** reply, int * len, void * data) + { ++ struct vectors * vecs = (struct vectors *)data; + char * param = get_keyparam(v, MAP); ++ struct multipath *mpp; + + param = convert_dev(param, 0); ++ mpp = find_mp_by_alias(vecs->mpvec, param); ++ if (!mpp) ++ return 1; ++ ++ if (mpp->wait_for_udev) { ++ condlog(2, "%s: device not fully created, failing reassign", ++ mpp->alias); ++ return 1; ++ } ++ + condlog(3, "%s: reset devices (operator)", param); + + dm_reassign(param); +Index: multipath-tools-130222/libmultipath/config.h +=================================================================== +--- multipath-tools-130222.orig/libmultipath/config.h ++++ multipath-tools-130222/libmultipath/config.h +@@ -142,6 +142,8 @@ struct config { + int retrigger_tries; + int retrigger_delay; + int new_bindings_in_boot; ++ int delayed_reconfig; ++ int uev_msg_delay; + unsigned int version[3]; + + char * dev; +Index: multipath-tools-130222/multipathd/main.c +=================================================================== +--- multipath-tools-130222.orig/multipathd/main.c ++++ multipath-tools-130222/multipathd/main.c +@@ -251,6 +251,47 @@ flush_map(struct multipath * mpp, struct + return 0; + } + ++int ++update_map (struct multipath *mpp, struct vectors *vecs) ++{ ++ int retries = 3; ++ char params[PARAMS_SIZE] = {0}; ++ ++retry: ++ condlog(4, "%s: updating new map", mpp->alias); ++ if (adopt_paths(vecs->pathvec, mpp, 1)) { ++ condlog(0, "%s: failed to adopt paths for new map update", ++ mpp->alias); ++ retries = -1; ++ goto fail; ++ } ++ verify_paths(mpp, vecs, NULL); ++ mpp->flush_on_last_del = FLUSH_UNDEF; ++ mpp->action = ACT_RELOAD; ++ ++ if (setup_map(mpp, params, PARAMS_SIZE)) { ++ condlog(0, "%s: failed to setup new map in update", mpp->alias); ++ retries = -1; ++ goto fail; ++ } ++ if (domap(mpp, params) <= 0 && retries-- > 0) { ++ condlog(0, "%s: map_udate sleep", mpp->alias); ++ sleep(1); ++ goto retry; ++ } ++ dm_lib_release(); ++ ++fail: ++ if (setup_multipath(vecs, mpp)) ++ return 1; ++ ++ sync_map_state(mpp); ++ ++ if (retries < 0) ++ condlog(0, "%s: failed reload in new map update", mpp->alias); ++ return 0; ++} ++ + static int + uev_add_map (struct uevent * uev, struct vectors * vecs) + { +@@ -293,6 +334,20 @@ ev_add_map (char * dev, char * alias, st + mpp = find_mp_by_alias(vecs->mpvec, alias); + + if (mpp) { ++ if (mpp->wait_for_udev > 1) { ++ if (update_map(mpp, vecs)) ++ /* setup multipathd removed the map */ ++ return 1; ++ } ++ if (mpp->wait_for_udev) { ++ mpp->wait_for_udev = 0; ++ if (conf->delayed_reconfig && ++ !need_to_delay_reconfig(vecs)) { ++ condlog(2, "reconfigure (delayed)"); ++ reconfigure(vecs); ++ return 0; ++ } ++ } + /* + * Not really an error -- we generate our own uevent + * if we create a multipath mapped device as a result +@@ -471,7 +526,14 @@ ev_add_path (struct path * pp, struct ve + condlog(0, "%s: failed to get path uid", pp->dev); + goto fail; /* leave path added to pathvec */ + } +- mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); ++ mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); ++ if (mpp && mpp->wait_for_udev) { ++ mpp->wait_for_udev = 2; ++ orphan_path(pp); ++ return 0; ++ } ++ ++ pp->mpp = mpp; + rescan: + if (mpp) { + if ((!pp->size) || (mpp->size != pp->size)) { +@@ -670,6 +732,12 @@ ev_remove_path (struct path *pp, struct + " removal of path %s", mpp->alias, pp->dev); + goto fail; + } ++ ++ if (mpp->wait_for_udev) { ++ mpp->wait_for_udev = 2; ++ goto out; ++ } ++ + /* + * reload the map + */ +@@ -731,6 +799,11 @@ uev_update_path (struct uevent *uev, str + condlog(2, "%s: update path write_protect to '%d' (uevent)", + uev->kernel, ro); + if (pp->mpp) { ++ if (pp->mpp->wait_for_udev) { ++ pp->mpp->wait_for_udev = 2; ++ return 0; ++ } ++ + retval = reload_map(vecs, pp->mpp, 0); + + condlog(2, "%s: map %s reloaded (retval %d)", +@@ -1063,6 +1136,20 @@ followover_should_failback(struct path * + } + + static void ++missing_uev_message_tick(vector mpvec) ++{ ++ struct multipath * mpp; ++ unsigned int i; ++ ++ vector_foreach_slot (mpvec, mpp, i) { ++ if (mpp->wait_for_udev && --mpp->uev_msg_tick <= 0) { ++ condlog(0, "%s: startup incomplete. Still waiting on udev", mpp->alias); ++ mpp->uev_msg_tick = conf->uev_msg_delay; ++ } ++ } ++} ++ ++static void + defered_failback_tick (vector mpvec) + { + struct multipath * mpp; +@@ -1316,6 +1403,9 @@ check_path (struct vectors * vecs, struc + + pp->state = newstate; + ++ ++ if (pp->mpp->wait_for_udev) ++ return; + /* + * path prio refreshing + */ +@@ -1369,6 +1459,7 @@ checkerloop (void *ap) + if (vecs->mpvec) { + defered_failback_tick(vecs->mpvec); + retry_count_tick(vecs->mpvec); ++ missing_uev_message_tick(vecs->mpvec); + } + if (count) + count--; +@@ -1464,6 +1555,22 @@ configure (struct vectors * vecs, int st + } + + int ++need_to_delay_reconfig(struct vectors * vecs) ++{ ++ struct multipath *mpp; ++ int i; ++ ++ if (!VECTOR_SIZE(vecs->mpvec)) ++ return 0; ++ ++ vector_foreach_slot(vecs->mpvec, mpp, i) { ++ if (mpp->wait_for_udev) ++ return 1; ++ } ++ return 0; ++} ++ ++int + reconfigure (struct vectors * vecs) + { + struct config * old = conf; +@@ -1543,12 +1650,18 @@ void + handle_signals(void) + { + if (reconfig_sig && running_state == DAEMON_RUNNING) { +- condlog(2, "reconfigure (signal)"); + pthread_cleanup_push(cleanup_lock, + &gvecs->lock); + lock(gvecs->lock); + pthread_testcancel(); +- reconfigure(gvecs); ++ if (need_to_delay_reconfig(gvecs)) { ++ conf->delayed_reconfig = 1; ++ condlog(2, "delaying reconfigure (signal)"); ++ } ++ else { ++ condlog(2, "reconfigure (signal)"); ++ reconfigure(gvecs); ++ } + lock_cleanup_pop(gvecs->lock); + } + if (log_reset_sig) { +Index: multipath-tools-130222/multipathd/main.h +=================================================================== +--- multipath-tools-130222.orig/multipathd/main.h ++++ multipath-tools-130222/multipathd/main.h +@@ -18,6 +18,7 @@ extern pid_t daemon_pid; + + void exit_daemon(void); + const char * daemon_status(void); ++int need_to_delay_reconfig (struct vectors *); + int reconfigure (struct vectors *); + int ev_add_path (struct path *, struct vectors *); + int ev_remove_path (struct path *, struct vectors *); +Index: multipath-tools-130222/libmultipath/config.c +=================================================================== +--- multipath-tools-130222.orig/libmultipath/config.c ++++ multipath-tools-130222/libmultipath/config.c +@@ -676,6 +676,7 @@ load_config (char * file, struct udev *u + conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES; + conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY; + conf->new_bindings_in_boot = 0; ++ conf->uev_msg_delay = DEFAULT_UEV_MSG_DELAY; + + /* + * preload default hwtable +Index: multipath-tools-130222/libmultipath/defaults.h +=================================================================== +--- multipath-tools-130222.orig/libmultipath/defaults.h ++++ multipath-tools-130222/libmultipath/defaults.h +@@ -23,6 +23,7 @@ + #define DEFAULT_DELAY_CHECKS DELAY_CHECKS_OFF + #define DEFAULT_RETRIGGER_DELAY 10 + #define DEFAULT_RETRIGGER_TRIES 3 ++#define DEFAULT_UEV_MSG_DELAY 30 + + #define DEFAULT_CHECKINT 5 + #define MAX_CHECKINT(a) (a << 2) +Index: multipath-tools-130222/libmultipath/dict.c +=================================================================== +--- multipath-tools-130222.orig/libmultipath/dict.c ++++ multipath-tools-130222/libmultipath/dict.c +@@ -872,6 +872,24 @@ def_retrigger_delay_handler(vector strve + } + + static int ++def_uev_msg_delay_handler(vector strvec) ++{ ++ char *buff; ++ ++ buff = set_value(strvec); ++ ++ if (!buff) ++ return 1; ++ ++ conf->uev_msg_delay = atoi(buff); ++ if (conf->uev_msg_delay <= 0) ++ conf->uev_msg_delay = DEFAULT_UEV_MSG_DELAY; ++ FREE(buff); ++ ++ return 0; ++} ++ ++static int + def_new_bindings_in_boot_handler(vector strvec) + { + char * buff; +@@ -3261,6 +3279,12 @@ snprint_def_retrigger_delay (char * buff + } + + static int ++snprint_def_uev_msg_delay (char * buff, int len, void * data) ++{ ++ return snprintf(buff, len, "%i", conf->uev_msg_delay); ++} ++ ++static int + snprint_def_new_bindings_in_boot(char * buff, int len, void * data) + { + if (conf->new_bindings_in_boot == 1) +@@ -3345,6 +3369,7 @@ init_keywords(void) + install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); + install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries); + install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay); ++ install_keyword("missing_uev_msg_delay", &def_uev_msg_delay_handler, &snprint_def_uev_msg_delay); + install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot); + __deprecated install_keyword("default_selector", &def_selector_handler, NULL); + __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); +Index: multipath-tools-130222/multipath.conf.defaults +=================================================================== +--- multipath-tools-130222.orig/multipath.conf.defaults ++++ multipath-tools-130222/multipath.conf.defaults +@@ -29,6 +29,7 @@ + # config_dir "/etc/multipath/conf.d" + # delay_watch_checks no + # delay_wait_checks no ++# missing_uev_msg_delay 30 + #} + #blacklist { + # devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" +Index: multipath-tools-130222/multipath/multipath.conf.5 +=================================================================== +--- multipath-tools-130222.orig/multipath/multipath.conf.5 ++++ multipath-tools-130222/multipath/multipath.conf.5 +@@ -478,6 +478,14 @@ used until it has passed + .I delay_wait_checks + checks. Default is + .I no ++.TP ++.B missing_uev_msg_delay ++Controls how long multipathd will wait, after a new multipath device is created, ++to receive a change event from udev for the device, before printing a warning ++message. This warning message will print every ++.I missing_uev_msg_delay ++seconds until the uevent is received. the default is ++.I 30 + . + .SH "blacklist section" + The diff --git a/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch b/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch new file mode 100644 index 0000000..742348f --- /dev/null +++ b/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch @@ -0,0 +1,236 @@ +--- + libmpathpersist/mpath_persist.c | 14 ++++++------ + libmultipath/discovery.c | 46 ++++++++++++++++++++-------------------- + libmultipath/discovery.h | 4 +++ + multipath/main.c | 2 - + multipathd/main.c | 6 +++-- + 5 files changed, 39 insertions(+), 33 deletions(-) + +Index: multipath-bz1328515/libmpathpersist/mpath_persist.c +=================================================================== +--- multipath-bz1328515.orig/libmpathpersist/mpath_persist.c ++++ multipath-bz1328515/libmpathpersist/mpath_persist.c +@@ -178,7 +178,7 @@ int mpath_persistent_reserve_in (int fd, + goto out; + } + +- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { ++ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { + ret = MPATH_PR_DMMP_ERROR; + goto out1; + } +@@ -262,13 +262,13 @@ int mpath_persistent_reserve_out ( int f + curmp = vector_alloc (); + pathvec = vector_alloc (); + +- if (!curmp || !pathvec){ +- condlog (0, "%s: vector allocation failed.", alias); +- ret = MPATH_PR_DMMP_ERROR; +- goto out; +- } ++ if (!curmp || !pathvec){ ++ condlog (0, "%s: vector allocation failed.", alias); ++ ret = MPATH_PR_DMMP_ERROR; ++ goto out; ++ } + +- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { ++ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { + ret = MPATH_PR_DMMP_ERROR; + goto out1; + } +Index: multipath-bz1328515/libmultipath/discovery.c +=================================================================== +--- multipath-bz1328515.orig/libmultipath/discovery.c ++++ multipath-bz1328515/libmultipath/discovery.c +@@ -32,7 +32,7 @@ int + store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice, + int flag, struct path **pp_ptr) + { +- int err = 1; ++ int err = PATHINFO_FAILED; + struct path * pp; + const char * devname; + +@@ -41,12 +41,12 @@ store_pathinfo (vector pathvec, vector h + + devname = udev_device_get_sysname(udevice); + if (!devname) +- return 1; ++ return PATHINFO_FAILED; + + pp = alloc_path(); + + if (!pp) +- return 1; ++ return PATHINFO_FAILED; + + if(safe_sprintf(pp->dev, "%s", devname)) { + condlog(0, "pp->dev too small"); +@@ -80,19 +80,16 @@ path_discover (vector pathvec, struct co + + devname = udev_device_get_sysname(udevice); + if (!devname) +- return 0; ++ return PATHINFO_FAILED; + + if (filter_devnode(conf->blist_devnode, conf->elist_devnode, + (char *)devname) > 0) +- return 0; ++ return PATHINFO_SKIPPED; + + pp = find_path_by_dev(pathvec, (char *)devname); + if (!pp) { +- if (store_pathinfo(pathvec, conf->hwtable, +- udevice, flag, NULL) != 1) +- return 0; +- else +- return 1; ++ return store_pathinfo(pathvec, conf->hwtable, ++ udevice, flag, NULL); + } + return pathinfo(pp, conf->hwtable, flag); + } +@@ -104,11 +101,11 @@ path_discovery (vector pathvec, struct c + struct udev_list_entry *entry; + struct udev_device *udevice; + const char *devpath; +- int r = 0; ++ int num_paths = 0, total_paths = 0; + + udev_iter = udev_enumerate_new(conf->udev); + if (!udev_iter) +- return 1; ++ return -ENOMEM; + + udev_enumerate_add_match_subsystem(udev_iter, "block"); + udev_enumerate_scan_devices(udev_iter); +@@ -121,17 +118,20 @@ path_discovery (vector pathvec, struct c + udevice = udev_device_new_from_syspath(conf->udev, devpath); + if (!udevice) { + condlog(4, "%s: no udev information", devpath); +- r++; + continue; + } + devtype = udev_device_get_devtype(udevice); +- if(devtype && !strncmp(devtype, "disk", 4)) +- r += path_discover(pathvec, conf, udevice, flag); ++ if(devtype && !strncmp(devtype, "disk", 4)) { ++ total_paths++; ++ if (path_discover(pathvec, conf, ++ udevice, flag) == PATHINFO_OK) ++ num_paths++; ++ } + udev_device_unref(udevice); + } + udev_enumerate_unref(udev_iter); +- condlog(4, "Discovery status %d", r); +- return r; ++ condlog(4, "Discovered %d/%d paths", num_paths, total_paths); ++ return (total_paths - num_paths); + } + + #define declare_sysfs_get_str(fname) \ +@@ -1021,7 +1021,7 @@ get_state (struct path * pp, int daemon) + + if (!checker_selected(c)) { + if (daemon) { +- if (pathinfo(pp, conf->hwtable, DI_SYSFS) != 0) { ++ if (pathinfo(pp, conf->hwtable, DI_SYSFS) != PATHINFO_OK) { + condlog(3, "%s: couldn't get sysfs pathinfo", + pp->dev); + return PATH_UNCHECKED; +@@ -1140,7 +1140,7 @@ pathinfo (struct path *pp, vector hwtabl + int path_state; + + if (!pp) +- return 1; ++ return PATHINFO_FAILED; + + condlog(3, "%s: mask = 0x%x", pp->dev, mask); + +@@ -1148,12 +1148,12 @@ pathinfo (struct path *pp, vector hwtabl + * fetch info available in sysfs + */ + if (mask & DI_SYSFS && sysfs_pathinfo(pp)) +- return 1; ++ return PATHINFO_FAILED; + + if (mask & DI_BLACKLIST && mask & DI_SYSFS) { + if (filter_device(conf->blist_device, conf->elist_device, + pp->vendor_id, pp->product_id) > 0) { +- return 2; ++ return PATHINFO_SKIPPED; + } + } + +@@ -1199,7 +1199,7 @@ pathinfo (struct path *pp, vector hwtabl + if (mask & DI_BLACKLIST && mask & DI_WWID) { + if (filter_wwid(conf->blist_wwid, conf->elist_wwid, + pp->wwid) > 0) { +- return 2; ++ return PATHINFO_SKIPPED; + } + } + +@@ -1213,7 +1213,7 @@ pathinfo (struct path *pp, vector hwtabl + } + } + +- return 0; ++ return PATHINFO_OK; + + blank: + /* +Index: multipath-bz1328515/libmultipath/discovery.h +=================================================================== +--- multipath-bz1328515.orig/libmultipath/discovery.h ++++ multipath-bz1328515/libmultipath/discovery.h +@@ -24,6 +24,10 @@ + #define SCSI_COMMAND_TERMINATED 0x22 + #define SG_ERR_DRIVER_SENSE 0x08 + ++#define PATHINFO_OK 0 ++#define PATHINFO_FAILED 1 ++#define PATHINFO_SKIPPED 2 ++ + struct config; + + int sysfs_get_dev (struct udev_device *udev, char * buff, size_t len); +Index: multipath-bz1328515/multipath/main.c +=================================================================== +--- multipath-bz1328515.orig/multipath/main.c ++++ multipath-bz1328515/multipath/main.c +@@ -344,7 +344,7 @@ configure (void) + /* maximum info */ + di_flag = DI_ALL; + +- if (path_discovery(pathvec, conf, di_flag)) ++ if (path_discovery(pathvec, conf, di_flag) < 0) + goto out; + + if (conf->verbosity > 2) +Index: multipath-bz1328515/multipathd/main.c +=================================================================== +--- multipath-bz1328515.orig/multipathd/main.c ++++ multipath-bz1328515/multipathd/main.c +@@ -1481,7 +1481,7 @@ configure (struct vectors * vecs, int st + struct multipath * mpp; + struct path * pp; + vector mpvec; +- int i; ++ int i, ret; + + if (!vecs->pathvec && !(vecs->pathvec = vector_alloc())) + return 1; +@@ -1495,7 +1495,9 @@ configure (struct vectors * vecs, int st + /* + * probe for current path (from sysfs) and map (from dm) sets + */ +- path_discovery(vecs->pathvec, conf, DI_ALL); ++ ret = path_discovery(vecs->pathvec, conf, DI_ALL); ++ if (ret < 0) ++ return 1; + + vector_foreach_slot (vecs->pathvec, pp, i){ + if (filter_path(conf, pp) > 0){ diff --git a/SPECS/device-mapper-multipath.spec b/SPECS/device-mapper-multipath.spec index 549dca6..d42cd98 100644 --- a/SPECS/device-mapper-multipath.spec +++ b/SPECS/device-mapper-multipath.spec @@ -1,7 +1,7 @@ Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.4.9 -Release: 85%{?dist}.1 +Release: 85%{?dist}.3 License: GPL+ Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -140,6 +140,8 @@ Patch0129: 0129-UPBZ-1254292-iscsi-targetname.patch Patch0130: 0130-RHBZ-1259523-host_name_len.patch Patch0131: 0131-UPBZ-1259831-lock-retry.patch Patch0132: 0132-RHBZ-1296979-fix-define.patch +Patch0133: 0133-RHBZ-1321019-wait-for-map-add.patch +Patch0134: 0134-UPBZ-1328515-dont-fail-discovery.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -324,6 +326,8 @@ kpartx manages partition creation and removal for device-mapper devices. %patch0130 -p1 %patch0131 -p1 %patch0132 -p1 +%patch0133 -p1 +%patch0134 -p1 cp %{SOURCE1} . %build @@ -418,6 +422,16 @@ bin/systemctl --no-reload enable multipathd.service >/dev/null 2>&1 ||: %{_mandir}/man8/kpartx.8.gz %changelog +* Tue Apr 19 2016 Benjamin Marzinski 0.4.9-85.3 +- Add 0134-UPBZ-1328515-dont-fail-discovery.patch + * don't fail discovery because individual paths failed. +- Resolves: bz #1328515 + +* Mon Mar 28 2016 Benjamin Marzinski 0.4.9-85.2 +- Add 0133-RHBZ-1321019-wait-for-map-add.patch + * wait for the device to finish being added before reloading it. +- Resolves: bz #1321019 + * Mon Feb 01 2016 Benjamin Marzinski 0.4.9-85.1 - Add 0132-RHBZ-1296979-fix-define.patch * look for the correct libudev function to set define