Hello community,

here is the log from the commit of package multipath-tools for openSUSE:Factory 
checked in at 2020-09-21 17:05:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/multipath-tools (Old)
 and      /work/SRC/openSUSE:Factory/.multipath-tools.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "multipath-tools"

Mon Sep 21 17:05:35 2020 rev:126 rq:835294 version:0.8.4+192+suse.1bc10ad

Changes:
--------
--- /work/SRC/openSUSE:Factory/multipath-tools/multipath-tools.changes  
2020-09-15 16:24:36.774385553 +0200
+++ 
/work/SRC/openSUSE:Factory/.multipath-tools.new.4249/multipath-tools.changes    
    2020-09-21 17:07:49.599159585 +0200
@@ -1,0 +2,23 @@
+Thu Sep 17 16:18:54 UTC 2020 - Martin Wilck <[email protected]>
+
+- Bugref for all minor fixes since SLE15-SP2 release (bsc#1176670)
+- Added README.alua
+
+-------------------------------------------------------------------
+Wed Sep 16 20:36:40 UTC 2020 - [email protected]
+
+- Update to version 0.8.4+192+suse.1bc10ad:
+  * Fix handling of hardware properties for maps without paths
+  (bsc#1176644)
+
+-------------------------------------------------------------------
+Wed Sep 16 16:44:13 UTC 2020 - [email protected]
+
+- Update to version 0.8.4+190+suse.fe234ea:
+  * Fixes for daemon shutdown issues from  SLE(bsc#1110060, bsc#1110439)
+    - multipathd: allow shutdown during configure()
+  * fix compilation of external programs with -lmultipath
+  (bsc#1133957, necessary after the above fix)
+  * Minor upstream fixes
+
+-------------------------------------------------------------------

Old:
----
  multipath-tools-0.8.4+183+suse.1817ce2.obscpio

New:
----
  multipath-tools-0.8.4+192+suse.1bc10ad.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ multipath-tools.spec ++++++
--- /var/tmp/diff_new_pack.yZF02x/_old  2020-09-21 17:08:02.595171268 +0200
+++ /var/tmp/diff_new_pack.yZF02x/_new  2020-09-21 17:08:02.595171268 +0200
@@ -39,7 +39,7 @@
 %define _sysdir usr/lib
 
 Name:           multipath-tools
-Version:        0.8.4+183+suse.1817ce2
+Version:        0.8.4+192+suse.1bc10ad
 Release:        0
 Summary:        Tools to Manage Multipathed Devices with the device-mapper
 License:        GPL-2.0-only
@@ -213,7 +213,7 @@
 
 %files
 %defattr(-,root,root)
-%doc README
+%doc README README.alua
 # SLE12-SP2 and earlier: dracut filesystem not own /usr/share/licenses
 %if 0%{?sle_version} && 0%{?sle_version} < 120300
 %dir %{_defaultlicensedir}

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.yZF02x/_old  2020-09-21 17:08:02.639171308 +0200
+++ /var/tmp/diff_new_pack.yZF02x/_new  2020-09-21 17:08:02.639171308 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/openSUSE/multipath-tools.git</param>
-              <param 
name="changesrevision">1817ce28a96a6440d8165de8696ceb2d23466261</param></service></servicedata>
\ No newline at end of file
+              <param 
name="changesrevision">1bc10ad9aee9598a36ee7107371a78b813baf968</param></service></servicedata>
\ No newline at end of file

++++++ multipath-tools-0.8.4+183+suse.1817ce2.obscpio -> 
multipath-tools-0.8.4+192+suse.1bc10ad.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/alias.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/alias.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/alias.c     
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/alias.c     
2020-09-16 22:32:07.000000000 +0200
@@ -580,7 +580,7 @@
        size_t line_len = 0;
        ssize_t n;
 
-       pthread_cleanup_push(free, line);
+       pthread_cleanup_push(cleanup_free_ptr, &line);
        while ((n = getline(&line, &line_len, file)) >= 0) {
                char *c, *alias, *wwid, *saveptr;
                const char *mpe_wwid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/config.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/config.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/config.c    
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/config.c    
2020-09-16 22:32:07.000000000 +0200
@@ -147,7 +147,7 @@
        int i;
        struct mpentry * mpe;
 
-       if (!wwid)
+       if (!wwid || !*wwid)
                return NULL;
 
        vector_foreach_slot (mptable, mpe, i)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/configure.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/configure.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/configure.c 
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/configure.c 
2020-09-16 22:32:07.000000000 +0200
@@ -298,6 +298,7 @@
        struct pathgroup * pgp;
        struct config *conf;
        int i, n_paths, marginal_pathgroups;
+       char *save_attr;
 
        /*
         * don't bother if devmap size is unknown
@@ -307,14 +308,17 @@
                return 1;
        }
 
-       /*
-        * free features, selector, and hwhandler properties if they are being 
reused
-        */
-       free_multipath_attributes(mpp);
        if (mpp->disable_queueing && VECTOR_SIZE(mpp->paths) != 0)
                mpp->disable_queueing = 0;
 
        /*
+        * If this map was created with add_map_without_path(),
+        * mpp->hwe might not be set yet.
+        */
+       if (!mpp->hwe)
+               extract_hwe_from_path(mpp);
+
+       /*
         * properties selectors
         *
         * Ordering matters for some properties:
@@ -328,12 +332,36 @@
 
        select_pgfailback(conf, mpp);
        select_pgpolicy(conf, mpp);
+
+       /*
+        * If setup_map() is called from e.g. from reload_map() or resize_map(),
+        * make sure that we don't corrupt attributes.
+        */
+       save_attr = steal_ptr(mpp->selector);
        select_selector(conf, mpp);
+       if (!mpp->selector)
+               mpp->selector = save_attr;
+       else
+               free(save_attr);
+
        select_no_path_retry(conf, mpp);
        select_retain_hwhandler(conf, mpp);
        select_skip_kpartx(conf, mpp);
+
+       save_attr = steal_ptr(mpp->features);
        select_features(conf, mpp);
+       if (!mpp->features)
+               mpp->features = save_attr;
+       else
+               free(save_attr);
+
+       save_attr = steal_ptr(mpp->hwhandler);
        select_hwhandler(conf, mpp);
+       if (!mpp->hwhandler)
+               mpp->hwhandler = save_attr;
+       else
+               free(save_attr);
+
        select_rr_weight(conf, mpp);
        select_minio(conf, mpp);
        select_mode(conf, mpp);
@@ -1139,6 +1167,12 @@
 
        vector_foreach_slot (pathvec, pp1, k) {
                int invalid;
+
+               if (should_exit()) {
+                       ret = CP_FAIL;
+                       goto out;
+               }
+
                /* skip this path for some reason */
 
                /* 1. if path has no unique id or wwid blacklisted */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/discovery.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/discovery.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/discovery.c 
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/discovery.c 
2020-09-16 22:32:07.000000000 +0200
@@ -200,6 +200,9 @@
                const char *devtype;
                const char *devpath;
 
+               if (should_exit())
+                       break;
+
                devpath = udev_list_entry_get_name(entry);
                condlog(4, "Discover device %s", devpath);
                udevice = udev_device_new_from_syspath(udev, devpath);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/hwtable.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/hwtable.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/hwtable.c   
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/hwtable.c   
2020-09-16 22:32:07.000000000 +0200
@@ -181,9 +181,9 @@
                .prio_name     = PRIO_ALUA,
        },
        {
-               /* MSA 1040, 1050, 2040 and 2050 families */
+               /* MSA 1040, 1050, 1060, 2040, 2050 and 2060 families */
                .vendor        = "HP",
-               .product       = "MSA [12]0[45]0 SA[NS]",
+               .product       = "MSA [12]0[456]0 SA[NS]",
                .pgpolicy      = GROUP_BY_PRIO,
                .pgfailback    = -FAILBACK_IMMEDIATE,
                .no_path_retry = 18,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/propsel.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/propsel.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/propsel.c   
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/propsel.c   
2020-09-16 22:32:07.000000000 +0200
@@ -65,9 +65,7 @@
        __do_set_from_vec(struct hwentry, var, (src)->hwe, dest)
 
 #define do_set_from_hwe(var, src, dest, msg)                           \
-       if (!src->hwe) {                                                \
-               condlog(0, "BUG: do_set_from_hwe called with hwe == NULL"); \
-       } else if (__do_set_from_hwe(var, src, dest)) {                 \
+       if (src->hwe && __do_set_from_hwe(var, src, dest)) {            \
                origin = msg;                                           \
                goto out;                                               \
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs.c   
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs.c   
2020-09-16 22:32:07.000000000 +0200
@@ -234,6 +234,17 @@
        return mpp;
 }
 
+void *set_mpp_hwe(struct multipath *mpp, const struct path *pp)
+{
+       if (!mpp || !pp || !pp->hwe)
+               return NULL;
+       if (mpp->hwe)
+               return mpp->hwe;
+       mpp->hwe = vector_convert(NULL, pp->hwe,
+                                 struct hwentry, identity);
+       return mpp->hwe;
+}
+
 void free_multipath_attributes(struct multipath *mpp)
 {
        if (!mpp)
@@ -290,6 +301,10 @@
 
        free_pathvec(mpp->paths, free_paths);
        free_pgvec(mpp->pg, free_paths);
+       if (mpp->hwe) {
+               vector_free(mpp->hwe);
+               mpp->hwe = NULL;
+       }
        FREE_PTR(mpp->mpcontext);
        FREE(mpp);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs.h 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs.h
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs.h   
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs.h   
2020-09-16 22:32:07.000000000 +0200
@@ -421,6 +421,7 @@
 struct path * alloc_path (void);
 struct pathgroup * alloc_pathgroup (void);
 struct multipath * alloc_multipath (void);
+void *set_mpp_hwe(struct multipath *mpp, const struct path *pp);
 void uninitialize_path(struct path *pp);
 void free_path (struct path *);
 void free_pathvec (vector vec, enum free_path_mode free_paths);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs_vec.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs_vec.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/structs_vec.c       
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/structs_vec.c       
2020-09-16 22:32:07.000000000 +0200
@@ -282,11 +282,6 @@
 void orphan_path(struct path *pp, const char *reason)
 {
        condlog(3, "%s: orphan path, %s", pp->dev, reason);
-       if (pp->mpp && pp->hwe && pp->mpp->hwe == pp->hwe) {
-               condlog(0, "BUG: orphaning path %s that holds hwe of %s",
-                       pp->dev, pp->mpp->alias);
-               pp->mpp->hwe = NULL;
-       }
        pp->mpp = NULL;
        uninitialize_path(pp);
 }
@@ -296,8 +291,6 @@
        int i;
        struct path * pp;
 
-       /* Avoid BUG message from orphan_path() */
-       mpp->hwe = NULL;
        vector_foreach_slot (pathvec, pp, i) {
                if (pp->mpp == mpp) {
                        if (pp->initialized == INIT_REMOVED) {
@@ -385,24 +378,26 @@
        if (mpp->hwe || !mpp->paths)
                return;
 
-       condlog(3, "%s: searching paths for valid hwe", mpp->alias);
+       condlog(4, "%s: searching paths for valid hwe", mpp->alias);
        /* doing this in two passes seems like paranoia to me */
        vector_foreach_slot(mpp->paths, pp, i) {
-               if (pp->state != PATH_UP)
-                       continue;
-               if (pp->hwe) {
-                       mpp->hwe = pp->hwe;
-                       return;
-               }
+               if (pp->state == PATH_UP &&
+                   pp->initialized != INIT_REMOVED && pp->hwe)
+                       goto done;
        }
        vector_foreach_slot(mpp->paths, pp, i) {
-               if (pp->state == PATH_UP)
-                       continue;
-               if (pp->hwe) {
-                       mpp->hwe = pp->hwe;
-                       return;
-               }
-       }
+               if (pp->state != PATH_UP &&
+                   pp->initialized != INIT_REMOVED && pp->hwe)
+                       goto done;
+       }
+done:
+       if (i < VECTOR_SIZE(mpp->paths))
+               (void)set_mpp_hwe(mpp, pp);
+
+       if (mpp->hwe)
+               condlog(3, "%s: got hwe from path %s", mpp->alias, pp->dev);
+       else
+               condlog(2, "%s: no hwe found", mpp->alias);
 }
 
 int
@@ -502,8 +497,6 @@
                }
                if (!found) {
                        condlog(3, "%s dropped path %s", mpp->alias, pp->dev);
-                       if (mpp->hwe == pp->hwe)
-                               mpp->hwe = NULL;
                        vector_del_slot(mpp->paths, i--);
                        orphan_path(pp, "path removed externally");
                }
@@ -512,8 +505,6 @@
        update_mpp_paths(mpp, pathvec);
        vector_foreach_slot (mpp->paths, pp, i)
                pp->mpp = mpp;
-       if (mpp->hwe == NULL)
-               extract_hwe_from_path(mpp);
 }
 
 int
@@ -689,9 +680,15 @@
 
        conf = get_multipath_config();
        mpp->mpe = find_mpe(conf->mptable, pp->wwid);
-       mpp->hwe = pp->hwe;
        put_multipath_config(conf);
 
+       /*
+        * We need to call this before select_alias(),
+        * because that accesses hwe properties.
+        */
+       if (pp->hwe && !set_mpp_hwe(mpp, pp))
+               goto out;
+
        strcpy(mpp->wwid, pp->wwid);
        find_existing_alias(mpp, vecs);
        if (select_alias(conf, mpp))
@@ -742,12 +739,6 @@
                        vector_del_slot(mpp->paths, i);
                        i--;
 
-                       /* Make sure mpp->hwe doesn't point to freed memory.
-                        * We call extract_hwe_from_path() below to restore
-                        * mpp->hwe
-                        */
-                       if (mpp->hwe == pp->hwe)
-                               mpp->hwe = NULL;
                        /*
                         * Don't delete path from pathvec yet. We'll do this
                         * after the path has been removed from the map, in
@@ -759,7 +750,6 @@
                                mpp->alias, pp->dev, pp->dev_t);
                }
        }
-       extract_hwe_from_path(mpp);
        return count;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/util.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/util.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/util.c      
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/util.c      
2020-09-16 22:32:07.000000000 +0200
@@ -401,6 +401,14 @@
        close((long)arg);
 }
 
+void cleanup_free_ptr(void *arg)
+{
+       void **p = arg;
+
+       if (p && *p)
+               free(*p);
+}
+
 struct bitfield *alloc_bitfield(unsigned int maxbit)
 {
        unsigned int n;
@@ -422,3 +430,8 @@
 {
        condlog(0, "%s: bitfield overflow: %u >= %u", f, bit, len);
 }
+
+int should_exit(void)
+{
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/util.h 
new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/util.h
--- old/multipath-tools-0.8.4+183+suse.1817ce2/libmultipath/util.h      
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/libmultipath/util.h      
2020-09-16 22:32:07.000000000 +0200
@@ -27,6 +27,7 @@
 int parse_prkey_flags(const char *ptr, uint64_t *prkey, uint8_t *flags);
 int safe_write(int fd, const void *buf, size_t count);
 void set_max_fds(rlim_t max_fds);
+int should_exit(void);
 
 #define KERNEL_VERSION(maj, min, ptc) ((((maj) * 256) + (min)) * 256 + (ptc))
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
@@ -47,6 +48,7 @@
        pthread_cleanup_push(((void (*)(void *))&f), (arg))
 
 void close_fd(void *arg);
+void cleanup_free_ptr(void *arg);
 
 struct scandir_result {
        struct dirent **di;
@@ -110,4 +112,11 @@
        bf->bits[bit / bits_per_slot] &= ~(1ULL << (bit % bits_per_slot));
 }
 
+#define steal_ptr(x)                  \
+       ({                             \
+               void *___p = x;        \
+               x = NULL;              \
+               ___p;                  \
+       })
+
 #endif /* _UTIL_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/multipathd/main.c 
new/multipath-tools-0.8.4+192+suse.1bc10ad/multipathd/main.c
--- old/multipath-tools-0.8.4+183+suse.1817ce2/multipathd/main.c        
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/multipathd/main.c        
2020-09-16 22:32:07.000000000 +0200
@@ -86,6 +86,7 @@
 
 #define FILE_NAME_SIZE 256
 #define CMDSIZE 160
+#define MSG_SIZE 32
 
 #define LOG_MSG(lvl, verb, pp)                                 \
 do {                                                           \
@@ -140,6 +141,11 @@
        return st;
 }
 
+int should_exit(void)
+{
+       return get_running_state() == DAEMON_SHUTDOWN;
+}
+
 /*
  * global copy of vecs for use in sig handlers
  */
@@ -154,52 +160,37 @@
 static volatile sig_atomic_t reconfig_sig;
 static volatile sig_atomic_t log_reset_sig;
 
+static const char *daemon_status_msg[DAEMON_STATUS_SIZE] = {
+       [DAEMON_INIT] = "init",
+       [DAEMON_START] = "startup",
+       [DAEMON_CONFIGURE] = "configure",
+       [DAEMON_IDLE] = "idle",
+       [DAEMON_RUNNING] = "running",
+       [DAEMON_SHUTDOWN] = "shutdown",
+};
+
 const char *
 daemon_status(void)
 {
-       switch (get_running_state()) {
-       case DAEMON_INIT:
-               return "init";
-       case DAEMON_START:
-               return "startup";
-       case DAEMON_CONFIGURE:
-               return "configure";
-       case DAEMON_IDLE:
-               return "idle";
-       case DAEMON_RUNNING:
-               return "running";
-       case DAEMON_SHUTDOWN:
-               return "shutdown";
-       }
-       return NULL;
+       int status = get_running_state();
+
+       if (status < DAEMON_INIT || status >= DAEMON_STATUS_SIZE)
+               return NULL;
+
+       return daemon_status_msg[status];
 }
 
 /*
  * I love you too, systemd ...
  */
 #ifdef USE_SYSTEMD
-static const char *
-sd_notify_status(enum daemon_status state)
-{
-       switch (state) {
-       case DAEMON_INIT:
-               return "STATUS=init";
-       case DAEMON_START:
-               return "STATUS=startup";
-       case DAEMON_CONFIGURE:
-               return "STATUS=configure";
-       case DAEMON_IDLE:
-       case DAEMON_RUNNING:
-               return "STATUS=up";
-       case DAEMON_SHUTDOWN:
-               return "STATUS=shutdown";
-       }
-       return NULL;
-}
-
 static void do_sd_notify(enum daemon_status old_state,
                         enum daemon_status new_state)
 {
+       char notify_msg[MSG_SIZE];
+       const char *msg;
+       static bool startup_done = false;
+
        /*
         * Checkerloop switches back and forth between idle and running state.
         * No need to tell systemd each time.
@@ -208,7 +199,19 @@
        if ((new_state == DAEMON_IDLE || new_state == DAEMON_RUNNING) &&
            (old_state == DAEMON_IDLE || old_state == DAEMON_RUNNING))
                return;
-       sd_notify(0, sd_notify_status(new_state));
+
+       if (new_state == DAEMON_IDLE || new_state == DAEMON_RUNNING)
+               msg = "up";
+       else
+               msg = daemon_status_msg[new_state];
+
+       if (msg && !safe_sprintf(notify_msg, "STATUS=%s", msg))
+               sd_notify(0, notify_msg);
+
+       if (new_state == DAEMON_IDLE && !startup_done) {
+               sd_notify(0, "READY=1");
+               startup_done = true;
+       }
 }
 #endif
 
@@ -1163,13 +1166,6 @@
                        vector_del_slot(mpp->paths, i);
 
                /*
-                * Make sure mpp->hwe doesn't point to freed memory
-                * We call extract_hwe_from_path() below to restore mpp->hwe
-                */
-               if (mpp->hwe == pp->hwe)
-                       mpp->hwe = NULL;
-
-               /*
                 * remove the map IF removing the last path
                 */
                if (VECTOR_SIZE(mpp->paths) == 0) {
@@ -1200,9 +1196,6 @@
                         */
                }
 
-               if (mpp->hwe == NULL)
-                       extract_hwe_from_path(mpp);
-
                if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {
                        condlog(0, "%s: failed to setup map for"
                                " removal of path %s", mpp->alias, pp->dev);
@@ -2589,6 +2582,9 @@
                goto fail;
        }
 
+       if (should_exit())
+               goto fail;
+
        conf = get_multipath_config();
        pthread_cleanup_push(put_multipath_config, conf);
        vector_foreach_slot (vecs->pathvec, pp, i){
@@ -2605,6 +2601,9 @@
                goto fail;
        }
 
+       if (should_exit())
+               goto fail;
+
        /*
         * create new set of maps & push changed ones into dm
         * In the first call, use FORCE_RELOAD_WEAK to avoid making
@@ -2619,6 +2618,9 @@
                goto fail;
        }
 
+       if (should_exit())
+               goto fail;
+
        /*
         * may need to remove some maps which are no longer relevant
         * e.g., due to blacklist changes in conf file
@@ -2630,6 +2632,9 @@
 
        dm_lib_release();
 
+       if (should_exit())
+               goto fail;
+
        sync_maps_state(mpvec);
        vector_foreach_slot(mpvec, mpp, i){
                if (remember_wwid(mpp->wwid) == 1)
@@ -2905,9 +2910,6 @@
        struct vectors * vecs;
        struct multipath * mpp;
        int i;
-#ifdef USE_SYSTEMD
-       int startup_done = 0;
-#endif
        int rc;
        int pid_fd = -1;
        struct config *conf;
@@ -3067,12 +3069,6 @@
                        }
                        lock_cleanup_pop(vecs->lock);
                        post_config_state(DAEMON_IDLE);
-#ifdef USE_SYSTEMD
-                       if (!startup_done) {
-                               sd_notify(0, "READY=1");
-                               startup_done = 1;
-                       }
-#endif
                }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/multipath-tools-0.8.4+183+suse.1817ce2/multipathd/main.h 
new/multipath-tools-0.8.4+192+suse.1bc10ad/multipathd/main.h
--- old/multipath-tools-0.8.4+183+suse.1817ce2/multipathd/main.h        
2020-08-27 11:31:57.000000000 +0200
+++ new/multipath-tools-0.8.4+192+suse.1bc10ad/multipathd/main.h        
2020-09-16 22:32:07.000000000 +0200
@@ -4,12 +4,13 @@
 #define MAPGCINT 5
 
 enum daemon_status {
-       DAEMON_INIT,
+       DAEMON_INIT = 0,
        DAEMON_START,
        DAEMON_CONFIGURE,
        DAEMON_IDLE,
        DAEMON_RUNNING,
        DAEMON_SHUTDOWN,
+       DAEMON_STATUS_SIZE,
 };
 
 struct prout_param_descriptor;

++++++ multipath-tools.obsinfo ++++++
--- /var/tmp/diff_new_pack.yZF02x/_old  2020-09-21 17:08:02.911171552 +0200
+++ /var/tmp/diff_new_pack.yZF02x/_new  2020-09-21 17:08:02.911171552 +0200
@@ -1,5 +1,5 @@
 name: multipath-tools
-version: 0.8.4+183+suse.1817ce2
-mtime: 1598520717
-commit: 1817ce28a96a6440d8165de8696ceb2d23466261
+version: 0.8.4+192+suse.1bc10ad
+mtime: 1600288327
+commit: 1bc10ad9aee9598a36ee7107371a78b813baf968
 


Reply via email to