All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Martin Wilck <mwilck@suse.com>
Subject: [PATCH v2 09/12] multipathd: use update_path_groups instead of reload_map
Date: Fri,  8 Mar 2019 17:12:02 -0600	[thread overview]
Message-ID: <1552086725-18476-10-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1552086725-18476-1-git-send-email-bmarzins@redhat.com>

reload_map() doesn't do the work to sync the state after reloading the
map.  Instead of calling it directly, cli_reload() and uev_update_path()
should call update_path_groups(), which calls reload_map() with all the
necessary syncing.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 multipathd/cli_handlers.c |  2 +-
 multipathd/main.c         | 13 ++++++++-----
 multipathd/main.h         |  2 ++
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index f95813e..60e17d6 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -877,7 +877,7 @@ cli_reload(void *v, char **reply, int *len, void *data)
 		return 1;
 	}
 
-	return reload_map(vecs, mpp, 0, 1);
+	return update_path_groups(mpp, vecs, 0);
 }
 
 int resize_map(struct multipath *mpp, unsigned long long size,
diff --git a/multipathd/main.c b/multipathd/main.c
index fd83a6a..7a317d9 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1273,10 +1273,13 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 			else {
 				if (ro == 1)
 					pp->mpp->force_readonly = 1;
-				retval = reload_map(vecs, mpp, 0, 1);
-				pp->mpp->force_readonly = 0;
-				condlog(2, "%s: map %s reloaded (retval %d)",
-					uev->kernel, mpp->alias, retval);
+				retval = update_path_groups(mpp, vecs, 0);
+				if (retval == 2)
+					condlog(2, "%s: map removed during reload", pp->dev);
+				else {
+					pp->mpp->force_readonly = 0;
+					condlog(2, "%s: map %s reloaded (retval %d)", uev->kernel, mpp->alias, retval);
+				}
 			}
 		}
 	}
@@ -1832,7 +1835,7 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
 
 	dm_lib_release();
 	if (setup_multipath(vecs, mpp) != 0)
-		return 1;
+		return 2;
 	sync_map_state(mpp);
 
 	return 0;
diff --git a/multipathd/main.h b/multipathd/main.h
index 8fd426b..e5c1398 100644
--- a/multipathd/main.h
+++ b/multipathd/main.h
@@ -43,5 +43,7 @@ int __setup_multipath (struct vectors * vecs, struct multipath * mpp,
 		       int reset);
 #define setup_multipath(vecs, mpp) __setup_multipath(vecs, mpp, 1)
 int update_multipath (struct vectors *vecs, char *mapname, int reset);
+int update_path_groups(struct multipath *mpp, struct vectors *vecs,
+		       int refresh);
 
 #endif /* MAIN_H */
-- 
2.17.2

  parent reply	other threads:[~2019-03-08 23:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 23:11 [PATCH v2 00/12] Misc Multipath patches Benjamin Marzinski
2019-03-08 23:11 ` [PATCH v2 01/12] libmultipath: disable user_friendly_names for NetApp Benjamin Marzinski
2019-03-17 15:04   ` Xose Vazquez Perez
2019-03-18  9:45     ` Martin Wilck
2019-03-08 23:11 ` [PATCH v2 02/12] libmultipath: handle existing paths in marginal_path enqueue Benjamin Marzinski
2019-03-08 23:11 ` [PATCH v2 03/12] multipathd: cleanup marginal paths checking timers Benjamin Marzinski
2019-03-08 23:11 ` [PATCH v2 04/12] libmultipath: fix marginal paths queueing errors Benjamin Marzinski
2019-03-08 23:11 ` [PATCH v2 05/12] libmultipath: fix marginal_paths nr_active check Benjamin Marzinski
2019-03-08 23:11 ` [PATCH v2 06/12] multipathd: Fix miscounting active paths Benjamin Marzinski
2019-03-08 23:12 ` [PATCH v2 07/12] multipathd: ignore failed wwid recheck Benjamin Marzinski
2019-03-15 11:48   ` Martin Wilck
2019-03-19 17:13     ` Benjamin Marzinski
2019-03-08 23:12 ` [PATCH v2 08/12] libmutipath: continue to use old state on PATH_PENDING Benjamin Marzinski
2019-03-08 23:12 ` Benjamin Marzinski [this message]
2019-03-15 11:49   ` [PATCH v2 09/12] multipathd: use update_path_groups instead of reload_map Martin Wilck
2019-03-08 23:12 ` [PATCH v2 10/12] multipath.conf: add missing options to man page Benjamin Marzinski
2019-03-15 11:49   ` Martin Wilck
2019-03-19 17:14     ` Benjamin Marzinski
2019-03-08 23:12 ` [PATCH v2 11/12] libmultipath: add get_uid fallback code for NVMe devices Benjamin Marzinski
2019-03-15 11:49   ` Martin Wilck
2019-03-19 17:15     ` Benjamin Marzinski
2019-03-20  7:55       ` Martin Wilck
2019-03-08 23:12 ` [PATCH v2 12/12] multipathd: change failed get_uid handling Benjamin Marzinski
2019-03-15 11:50   ` Martin Wilck
2019-03-19 17:20     ` Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1552086725-18476-10-git-send-email-bmarzins@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=mwilck@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.