summaryrefslogtreecommitdiffstats
path: root/0104-RHBZ-631009-deferred-remove.patch
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2016-04-21 21:27:49 -0500
committerBenjamin Marzinski <bmarzins@redhat.com>2016-04-21 21:27:49 -0500
commit6738b34a0b0aabf1bc8c15d540bafa29ca99c58f (patch)
treecf5a37898b4bacc7fefcc08db661338bfdb9ffec /0104-RHBZ-631009-deferred-remove.patch
parentfef216999bec3651f01b934a3ece5a69f6eca598 (diff)
downloaddevice-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.tar.gz
device-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.tar.xz
device-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.zip
device-mapper-multipath-0.4.9-82
- Modify 0005-RH-add-mpathconf.patch * changed warning message - Modify 0102-RHBZ-1160478-mpathconf-template.patch * updated man page - Modify 0104-RHBZ-631009-deferred-remove.patch * refactor code and minor fix - Refresh 0107-RHBZ-1169935-no-new-devs.patch - Refresh 0112-RHBZ-1194917-add-config_dir-option.patch - Refresh 0126-RHBZ-1211383-alias-collision.patch - Add 0133-RHBZ-1296979-fix-define.patch * look for the correct libudev function to set define - Add 0134-RHBZ-1241528-check-mpath-prefix.patch * only touch devices with a "mpath-" dm uuid prefix - Add 0135-RHBZ-1299600-path-dev-uevents.patch * trigger path uevent the first time a path is claimed by multipath - Add 0136-RHBZ-1304687-wait-for-map-add.patch * wait for the device to finish being added before reloading it. - Add 0137-RHBZ-1280524-clear-chkr-msg.patch - Add 0138-RHBZ-1288660-fix-mpathconf-allow.patch * don't remove existing lines from blacklist_exceptions section - Add 0139-RHBZ-1273173-queue-no-daemon-doc.patch - Add 0140-RHBZ-1299647-fix-help.patch - Add 0141-RHBZ-1303953-mpathpersist-typo.patch - Add 0142-RHBZ-1283750-kpartx-fix.patch * only remove devices if their uuid says that they are the correct partition device - Add 0143-RHBZ-1299648-kpartx-sync.patch * default to using udev sync mode - Add 0144-RHBZ-1299652-alua-pref-arg.patch * allow "exclusive_pref_bit" argument to alua prioritizer - Add 0145-UP-resize-help-msg.patch - Add 0146-UPBZ-1299651-raw-output.patch * allow raw format mutipathd show commands, that remove headers and padding - Add 0147-RHBZ-1272620-fail-rm-msg.patch - Add 0148-RHBZ-1292599-verify-before-remove.patch * verify that all partitions are unused before attempting to remove a device - Add 0149-RHBZ-1292599-restore-removed-parts.patch * don't disable kpartx when restoring the first path of a device. - Add 0150-RHBZ-1253913-fix-startup-msg.patch * wait for multipathd daemon to write pidfile before returning - Add 0151-RHBZ-1297456-weighted-fix.patch * add wwn keyword to weighted prioritizer for persistent naming - Add 0152-RHBZ-1269293-fix-blk-unit-file.patch * use "Wants" instead of "Requires" - Add 0153-RH-fix-i686-size-bug.patch * use 64-bit keycodes for multipathd client commands - Add 0154-UPBZ-1291406-disable-reinstate.patch * don't automatically reinstate ghost paths for implicit alua devices - Add 0155-UPBZ-1300415-PURE-config.patch * Add default config for PURE FlashArray - Add 0156-UPBZ-1313324-dont-fail-discovery.patch * don't fail discovery because individual paths failed. - Add 0157-RHBZ-1319853-multipath-c-error-msg.patch * better error reporting for multipath -c - Add 0158-RHBZ-1318581-timestamp-doc-fix.patch * add documentation for -T - Add 0159-UPBZ-1255885-udev-waits.patch * make multipath and kpartx wait after for udev after each command
Diffstat (limited to '0104-RHBZ-631009-deferred-remove.patch')
-rw-r--r--0104-RHBZ-631009-deferred-remove.patch79
1 files changed, 46 insertions, 33 deletions
diff --git a/0104-RHBZ-631009-deferred-remove.patch b/0104-RHBZ-631009-deferred-remove.patch
index 342b45d..07f734c 100644
--- a/0104-RHBZ-631009-deferred-remove.patch
+++ b/0104-RHBZ-631009-deferred-remove.patch
@@ -1,19 +1,19 @@
---
- libmultipath/Makefile | 6 ++
- libmultipath/config.c | 3 +
- libmultipath/config.h | 3 +
+ libmultipath/Makefile | 6 +
+ libmultipath/config.c | 3
+ libmultipath/config.h | 3
libmultipath/configure.c | 1
libmultipath/defaults.h | 1
- libmultipath/devmapper.c | 130 +++++++++++++++++++++++++++++++++++++++------
- libmultipath/devmapper.h | 12 ++--
- libmultipath/dict.c | 116 +++++++++++++++++++++++++++++++++++++++-
- libmultipath/propsel.c | 28 +++++++++
+ libmultipath/devmapper.c | 142 ++++++++++++++++++++++++++++++++++++++++-----
+ libmultipath/devmapper.h | 11 ++-
+ libmultipath/dict.c | 116 ++++++++++++++++++++++++++++++++++++
+ libmultipath/propsel.c | 28 ++++++++
libmultipath/propsel.h | 1
libmultipath/structs.h | 8 ++
- libmultipath/structs_vec.c | 3 -
- multipath/multipath.conf.5 | 36 ++++++++++++
+ libmultipath/structs_vec.c | 3
+ multipath/multipath.conf.5 | 36 +++++++++++
multipathd/main.c | 23 +++++--
- 14 files changed, 344 insertions(+), 27 deletions(-)
+ 14 files changed, 355 insertions(+), 27 deletions(-)
Index: multipath-tools-130222/libmultipath/config.c
===================================================================
@@ -99,7 +99,16 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/devmapper.c
+++ multipath-tools-130222/libmultipath/devmapper.c
-@@ -103,7 +103,9 @@ dm_lib_prereq (void)
+@@ -32,6 +32,8 @@
+ #define UUID_PREFIX "mpath-"
+ #define UUID_PREFIX_LEN 6
+
++static int dm_cancel_remove_partmaps(const char * mapname);
++
+ #ifndef LIBDM_API_COOKIE
+ static inline int dm_task_set_cookie(struct dm_task *dmt, uint32_t *c, int a)
+ {
+@@ -103,7 +105,9 @@ dm_lib_prereq (void)
{
char version[64];
int v[3];
@@ -110,28 +119,31 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
int minv[3] = {1, 2, 82};
#elif defined(LIBDM_API_COOKIE)
int minv[3] = {1, 2, 38};
-@@ -202,7 +204,7 @@ dm_prereq (void)
+@@ -201,8 +205,10 @@ dm_prereq (void)
+ return dm_drv_prereq();
}
++#define do_deferred(x) ((x) == DEFERRED_REMOVE_ON || (x) == DEFERRED_REMOVE_IN_PROGRESS)
++
static int
-dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags) {
+dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags, int deferred_remove) {
int r = 0;
int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME ||
task == DM_DEVICE_REMOVE));
-@@ -220,7 +222,10 @@ dm_simplecmd (int task, const char *name
+@@ -220,7 +226,10 @@ dm_simplecmd (int task, const char *name
if (no_flush)
dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */
#endif
-
+#ifdef LIBDM_API_DEFERRED
-+ if (deferred_remove)
++ if (do_deferred(deferred_remove))
+ dm_task_deferred_remove(dmt);
+#endif
if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags))
goto out;
r = dm_task_run (dmt);
-@@ -232,12 +237,18 @@ dm_simplecmd (int task, const char *name
+@@ -232,12 +241,18 @@ dm_simplecmd (int task, const char *name
extern int
dm_simplecmd_flush (int task, const char *name, int needsync, uint16_t udev_flags) {
@@ -145,14 +157,14 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
+ return dm_simplecmd(task, name, 1, 1, udev_flags, 0);
+}
+
-+extern int
++static int
+dm_device_remove (const char *name, int needsync, int deferred_remove) {
+ return dm_simplecmd(DM_DEVICE_REMOVE, name, 0, needsync, 0,
+ deferred_remove);
}
extern int
-@@ -653,7 +664,7 @@ out:
+@@ -653,7 +668,7 @@ out:
}
extern int
@@ -161,7 +173,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
{
int r;
-@@ -663,23 +674,46 @@ _dm_flush_map (const char * mapname, int
+@@ -663,23 +678,46 @@ _dm_flush_map (const char * mapname, int
if (dm_type(mapname, TGT_MPATH) <= 0)
return 0; /* nothing to do */
@@ -170,7 +182,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
return 1;
- if (dm_get_opencount(mapname)) {
-+ if (!deferred_remove && dm_get_opencount(mapname)) {
++ if (!do_deferred(deferred_remove) && dm_get_opencount(mapname)) {
condlog(2, "%s: map in use", mapname);
return 1;
}
@@ -179,7 +191,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
+ r = dm_device_remove(mapname, need_sync, deferred_remove);
if (r) {
-+ if (deferred_remove && dm_map_present(mapname)) {
++ if (do_deferred(deferred_remove) && dm_map_present(mapname)) {
+ condlog(4, "multipath map %s remove deferred",
+ mapname);
+ return 2;
@@ -211,7 +223,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
extern int
dm_suspend_and_flush_map (const char * mapname)
{
-@@ -1076,6 +1110,7 @@ out:
+@@ -1076,6 +1114,7 @@ out:
struct remove_data {
int need_sync;
@@ -219,14 +231,15 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
};
static int
-@@ -1084,25 +1119,90 @@ remove_partmap(char *name, void *data)
+@@ -1084,25 +1123,98 @@ remove_partmap(char *name, void *data)
struct remove_data *rd = (struct remove_data *)data;
if (dm_get_opencount(name)) {
- dm_remove_partmaps(name, rd->need_sync);
- if (dm_get_opencount(name)) {
+ dm_remove_partmaps(name, rd->need_sync, rd->deferred_remove);
-+ if (!rd->deferred_remove && dm_get_opencount(name)) {
++ if (!do_deferred(rd->deferred_remove) &&
++ dm_get_opencount(name)) {
condlog(2, "%s: map in use", name);
return 1;
}
@@ -252,6 +265,8 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
+static int
+cancel_remove_partmap (char *name, void *unused)
+{
++ if (dm_get_opencount(name))
++ dm_cancel_remove_partmaps(name);
+ if (dm_message(name, "@cancel_deferred_remove") != 0)
+ condlog(0, "%s: can't cancel deferred remove: %s", name,
+ strerror(errno));
@@ -283,6 +298,11 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
+ return r;
+}
+
++static int
++dm_cancel_remove_partmaps(const char * mapname) {
++ return do_foreach_partmaps(mapname, cancel_remove_partmap, NULL);
++}
++
+int
+dm_cancel_deferred_remove (struct multipath *mpp)
+{
@@ -293,7 +313,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.c
+ if (mpp->deferred_remove == DEFERRED_REMOVE_IN_PROGRESS)
+ mpp->deferred_remove = DEFERRED_REMOVE_ON;
+
-+ do_foreach_partmaps(mpp->alias, cancel_remove_partmap, NULL);
++ dm_cancel_remove_partmaps(mpp->alias);
+ r = dm_message(mpp->alias, "@cancel_deferred_remove");
+ if (r)
+ condlog(0, "%s: can't cancel deferred remove: %s", mpp->alias,
@@ -320,14 +340,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/devmapper.h
+++ multipath-tools-130222/libmultipath/devmapper.h
-@@ -17,15 +17,18 @@ int dm_prereq (void);
- int dm_drv_version (unsigned int * version, char * str);
- int dm_simplecmd_flush (int, const char *, int, uint16_t);
- int dm_simplecmd_noflush (int, const char *, uint16_t);
-+int dm_device_remove (const char *, int, int);
- int dm_addmap_create (struct multipath *mpp, char *params);
- int dm_addmap_reload (struct multipath *mpp, char *params);
- int dm_map_present (const char *);
+@@ -23,9 +23,11 @@ int dm_map_present (const char *);
int dm_get_map(const char *, unsigned long long *, char *);
int dm_get_status(char *, char *);
int dm_type(const char *, char *);
@@ -342,7 +355,7 @@ Index: multipath-tools-130222/libmultipath/devmapper.h
int dm_suspend_and_flush_map(const char * mapname);
int dm_flush_maps (void);
int dm_fail_path(char * mapname, char * path);
-@@ -40,7 +43,8 @@ int dm_geteventnr (char *name);
+@@ -40,7 +42,8 @@ int dm_geteventnr (char *name);
int dm_get_major (char *name);
int dm_get_minor (char *name);
char * dm_mapname(int major, int minor);