device-mapper-multipath/0009-multipathd-use-update_path_groups-instead-of-reload_.patch
Benjamin Marzinski 35f5570500 device-mapper-multipath-0.8.0-1
Update Source to upstream version 0.8.0
  * Previous patches 0006 & 0007 are included in this commit
Rename files
  * Previous patches 0008-0016 & 0100 are now patches 0018-0027
Add 0006-multipathd-Fix-miscounting-active-paths.patch
Add 0007-multipathd-ignore-failed-wwid-recheck.patch
  * multipathd will no longer disable paths if it is unable to
    get their wwid on a change event
Add 0008-libmutipath-continue-to-use-old-state-on-PATH_PENDIN.patch
Add 0009-multipathd-use-update_path_groups-instead-of-reload_.patch
Add 0010-multipath.conf-add-missing-options-to-man-page.patch
Add 0011-libmultipath-add-get_uid-fallback-code-for-NVMe-devi.patch
Add 0012-libmulitpath-cleanup-uid_fallback-code.patch
Add 0013-multipathd-handle-changed-wwids-by-removal-and-addit.patch
  * if a path device changes wwid, it will now be removed and re-added
    to the correct multipath device.
Add 0014-multipathd-remove-wwid_changed-path-attribute.patch
Add 0015-multipathd-ignore-disable_changed_wwids.patch
Add 0016-multipathd-Don-t-use-fallback-code-after-getting-wwi.patch
Add 0017-libmultipath-silence-dm_is_mpath-error-messages.patch
  * The above 12 patches have been submitted upstream
2019-04-05 00:20:53 -05:00

77 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Thu, 21 Feb 2019 17:00:17 -0600
Subject: [PATCH] multipathd: use update_path_groups instead of reload_map
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