diff --git a/0001-change-order-of-multipath.rules.patch b/0001-change-order-of-multipath.rules.patch index 90de0e73e53c42a42d170c2e6ef537866044aca6..4dc253f164374e9dcfc15decae35f597fbff1658 100644 --- a/0001-change-order-of-multipath.rules.patch +++ b/0001-change-order-of-multipath.rules.patch @@ -1,4 +1,4 @@ -From 4340aca696857c1077b00ff6bdc0454a07929aad Mon Sep 17 00:00:00 2001 +From afc8dd3d344cd23f7ea861fa52b2d83bf0c3f036 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Fri, 15 May 2015 18:14:09 -0500 Subject: [PATCH] change order of multipath.rules diff --git a/0004-RH-add-mpathconf.patch b/0002-RH-add-mpathconf.patch similarity index 99% rename from 0004-RH-add-mpathconf.patch rename to 0002-RH-add-mpathconf.patch index 10af8449c8b822214504b92ec8091bc807b1047b..08c62cc55a8f64c53f3f48831688e759e3c10598 100644 --- a/0004-RH-add-mpathconf.patch +++ b/0002-RH-add-mpathconf.patch @@ -1,4 +1,4 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From eb3e69bd510b20772734724d02f84c2e3946d560 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Thu, 16 Oct 2014 15:49:01 -0500 Subject: [PATCH] RH: add mpathconf @@ -11,7 +11,7 @@ with the OS defaults, and to enable and disable multipathing via a single command. Changed-by: hy-euler - Do not modify the file libmultipath/config.c, because it modifies + Do not modify the file libmultipath/config.c, because it modifies another patch which is not present in openEuler. Signed-off-by: Benjamin Marzinski @@ -654,6 +654,5 @@ index 0000000..5b7ae0c +.SH AUTHOR +Benjamin Marzinski -- -2.7.4 - +1.8.3.1 diff --git a/0002-libmpathpersist-depend-on-libmultipath.patch b/0002-libmpathpersist-depend-on-libmultipath.patch deleted file mode 100644 index 62769f265cc5f42cda2ed09728e2ba0a5406995a..0000000000000000000000000000000000000000 --- a/0002-libmpathpersist-depend-on-libmultipath.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 48f537b9fef4f9db761466b8951fb63243f06602 Mon Sep 17 00:00:00 2001 -From: Christian Hesse -Date: Wed, 6 May 2020 09:35:47 +0200 -Subject: [PATCH] libmpathpersist: depend on libmultipath - -Without this the build fails with: - -/usr/bin/ld: cannot find -lmultipath - -Signed-off-by: Christian Hesse ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 1dee368..ba1d73b 100644 ---- a/Makefile -+++ b/Makefile -@@ -28,7 +28,7 @@ all: $(BUILDDIRS) - $(BUILDDIRS): - $(MAKE) -C $@ - --multipath multipathd mpathpersist: libmultipath -+libmpathpersist multipath multipathd mpathpersist: libmultipath - mpathpersist: libmpathpersist - - $(BUILDDIRS.clean): --- -1.8.3.1 - diff --git a/0005-RH-Remove-the-property-blacklist-exception-builtin.patch b/0003-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 55% rename from 0005-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0003-RH-Remove-the-property-blacklist-exception-builtin.patch index 8f6efb04211091577623b93da90b93b715c47919..a471923f316b8c4d5bfb1ed28766325167c851b3 100644 --- a/0005-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/0003-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -1,4 +1,4 @@ -From e6ed042c280b0e40185490a9a69cccbcdf75bbf4 Mon Sep 17 00:00:00 2001 +From 1d147380cd35cf2576420347514b67972f972ac3 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Wed, 2 Jul 2014 12:49:53 -0500 Subject: [PATCH] RH: Remove the property blacklist exception builtin @@ -13,38 +13,26 @@ it. Signed-off-by: Benjamin Marzinski --- - libmultipath/blacklist.c | 12 ++++-------- - multipath/multipath.conf.5 | 12 ++++++------ - 2 files changed, 10 insertions(+), 14 deletions(-) + libmultipath/blacklist.c | 6 ++---- + multipath/multipath.conf.5 | 11 ++++++----- + tests/blacklist.c | 7 ++----- + 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c -index 00e8dbd..a8e0311 100644 +index 6c6a597..785f5ee 100644 --- a/libmultipath/blacklist.c +++ b/libmultipath/blacklist.c -@@ -204,12 +204,6 @@ setup_default_blist (struct config * conf) - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) +@@ -201,9 +201,6 @@ setup_default_blist (struct config * conf) + if (store_ble(conf->blist_devnode, "!^(sd[a-z]|dasd[a-z]|nvme[0-9])", ORIGIN_DEFAULT)) return 1; -- str = STRDUP("(SCSI_IDENT_|ID_WWN)"); -- if (!str) -- return 1; -- if (store_ble(conf->elist_property, str, ORIGIN_DEFAULT)) +- if (store_ble(conf->elist_property, "(SCSI_IDENT_|ID_WWN)", ORIGIN_DEFAULT)) - return 1; - vector_foreach_slot (conf->hwtable, hwe, i) { if (hwe->bl_product) { if (find_blacklist_device(conf->blist_device, -@@ -395,7 +389,8 @@ filter_property(struct config *conf, struct udev_device *udev, int lvl, - if (udev) { - /* - * This is the inverse of the 'normal' matching; -- * the environment variable _has_ to match. -+ * the environment variable _has_ to match -+ * if a whitelist is present. - * But only if the uid_attribute used for determining the WWID - * of the path is is present in the environment - * (uid_attr_seen). If this is not the case, udev probably -@@ -411,7 +406,8 @@ filter_property(struct config *conf, struct udev_device *udev, int lvl, +@@ -407,7 +404,8 @@ filter_property(const struct config *conf, struct udev_device *udev, *uid_attribute != '\0'; bool uid_attr_seen = false; @@ -55,10 +43,10 @@ index 00e8dbd..a8e0311 100644 udev_device_get_properties_list_entry(udev)) { diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 -index 05a5e8f..2f2d8cc 100644 +index d2101ed..098523c 100644 --- a/multipath/multipath.conf.5 +++ b/multipath/multipath.conf.5 -@@ -1286,7 +1286,8 @@ keywords. Both are regular expressions. For a full description of these keywords +@@ -1313,9 +1313,14 @@ keywords. Both are regular expressions. For a full description of these keywords Regular expression for an udev property. All devices that have matching udev properties will be excluded/included. The handling of the \fIproperty\fR keyword is special, @@ -67,8 +55,14 @@ index 05a5e8f..2f2d8cc 100644 +least one whitelisted udev property; otherwise they're treated as blacklisted, and the message "\fIblacklisted, udev property missing\fR" is displayed in the logs. ++For example, setting the property blacklist_exception to ++\fB(SCSI_IDENT_|ID_WWN)\fR, will cause well-behaved SCSI devices and devices ++that provide a WWN (World Wide Number) to be included, and all others to be ++excluded. This works to exclude most non-multipathable devices. . -@@ -1299,11 +1300,10 @@ Blacklisting by missing properties is only applied to devices which do have the + .RS + .PP +@@ -1326,10 +1331,6 @@ Blacklisting by missing properties is only applied to devices which do have the property specified by \fIuid_attribute\fR (e.g. \fIID_SERIAL\fR) set. Previously, it was applied to every device, possibly causing devices to be blacklisted because of temporary I/O error conditions. @@ -76,14 +70,35 @@ index 05a5e8f..2f2d8cc 100644 -The default \fIblacklist exception\fR is: \fB(SCSI_IDENT_|ID_WWN)\fR, causing -well-behaved SCSI devices and devices that provide a WWN (World Wide Number) -to be included, and all others to be excluded. --.RE -+For example, setting the property blacklist_exception to -+\fB(SCSI_IDENT_|ID_WWN)\fR, will cause well-behaved SCSI devices and devices -+that provide a WWN (World Wide Number) to be included, and all others to be -+excluded. This works to exclude most non-multipathable devices. + .RE .TP .B protocol - Regular expression for the protocol of a device to be excluded/included. +diff --git a/tests/blacklist.c b/tests/blacklist.c +index 84a3ba2..adfbf28 100644 +--- a/tests/blacklist.c ++++ b/tests/blacklist.c +@@ -373,9 +373,8 @@ static void test_property_missing(void **state) + { + static struct udev_device udev = { "sdb", { "ID_FOO", "ID_BAZ", "ID_BAR", "ID_SERIAL", NULL } }; + conf.blist_property = blist_property_wwn; +- expect_condlog(3, "sdb: blacklisted, udev property missing\n"); + assert_int_equal(filter_property(&conf, &udev, 3, "ID_SERIAL"), +- MATCH_PROPERTY_BLIST_MISSING); ++ MATCH_NOTHING); + assert_int_equal(filter_property(&conf, &udev, 3, "ID_BLAH"), + MATCH_NOTHING); + assert_int_equal(filter_property(&conf, &udev, 3, ""), +@@ -467,9 +466,7 @@ static void test_filter_path_missing1(void **state) + conf.blist_device = blist_device_foo_bar; + conf.blist_protocol = blist_protocol_fcp; + conf.blist_wwid = blist_wwid_xyzzy; +- expect_condlog(3, "sdb: blacklisted, udev property missing\n"); +- assert_int_equal(filter_path(&conf, &miss1_pp), +- MATCH_PROPERTY_BLIST_MISSING); ++ assert_int_equal(filter_path(&conf, &miss1_pp), MATCH_NOTHING); + } + + /* This one matches the property whitelist, to test the other missing -- 1.8.3.1 diff --git a/0003-libmultipath-assign-variable-to-make-gcc-happy.patch b/0003-libmultipath-assign-variable-to-make-gcc-happy.patch deleted file mode 100644 index 5117319882a551c40ee2655caa2ff37397af8870..0000000000000000000000000000000000000000 --- a/0003-libmultipath-assign-variable-to-make-gcc-happy.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 62bb0b61704e84e782edb2d8341060992152f25e Mon Sep 17 00:00:00 2001 -From: Benjamin Marzinski -Date: Wed, 25 Mar 2020 23:22:46 -0500 -Subject: [PATCH] libmultipath: assign variable to make gcc happy -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There is nothing wrong with is_queueing not being set at the start -of __set_no_path_retry(), it will always get set before it is accessed, -but gcc 8.2.1 is failing with - -structs_vec.c: In function ‘__set_no_path_retry’: -structs_vec.c:339:7: error: ‘is_queueing’ may be used uninitialized in -this function [-Werror=maybe-uninitialized] - bool is_queueing; - ^~~~~~~~~~~ - -so, assign a value to make it happy. - -Reviewed-by: Martin Wilck -Signed-off-by: Benjamin Marzinski ---- - libmultipath/structs_vec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 3dbbaa0..077f2e4 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -336,7 +336,7 @@ static void leave_recovery_mode(struct multipath *mpp) - - void __set_no_path_retry(struct multipath *mpp, bool check_features) - { -- bool is_queueing; -+ bool is_queueing = false; /* assign a value to make gcc happy */ - - check_features = check_features && mpp->features != NULL; - if (check_features) --- -1.8.3.1 - diff --git a/0006-fix-syntax-error.patch b/0004-fix-syntax-error.patch similarity index 86% rename from 0006-fix-syntax-error.patch rename to 0004-fix-syntax-error.patch index 45d91fccad98321ffc87b081ad0fb2e245865655..28b73e3511a4fe3d526e4980fbc43c1c5eb0e054 100644 --- a/0006-fix-syntax-error.patch +++ b/0004-fix-syntax-error.patch @@ -1,4 +1,4 @@ -From 8e4c5a421ee351fe667b0bf8b99e691ab5c9c13b Mon Sep 17 00:00:00 2001 +From c220115428e3de8f189afccadf6dc823825429fa Mon Sep 17 00:00:00 2001 From: wangjufeng Date: Fri, 1 Nov 2019 16:48:49 +0800 Subject: [PATCH] fix syntax error @@ -8,7 +8,7 @@ Subject: [PATCH] fix syntax error 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc -index d4d1e0d..158e7b6 100644 +index e05f3a9..f4d895d 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -41,7 +41,7 @@ ifndef SYSTEMD diff --git a/0007-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch b/0005-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch similarity index 83% rename from 0007-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch rename to 0005-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch index f87a90c961cd7ba402b6df4daa78e1b298b5667d..6394ef7e89d99c8abe5a83d395ff8dd4a7e04dab 100644 --- a/0007-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch +++ b/0005-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch @@ -1,6 +1,6 @@ --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c -@@ -593,9 +593,10 @@ +@@ -981,9 +981,10 @@ cli_resize(void *v, char **reply, int *len, void *data) char * mapname = get_keyparam(v, MAP); struct multipath *mpp; int minor; @@ -12,7 +12,7 @@ mapname = convert_dev(mapname, 0); condlog(2, "%s: resize map (operator)", mapname); -@@ -627,6 +628,22 @@ +@@ -1021,6 +1022,22 @@ cli_resize(void *v, char **reply, int *len, void *data) mapname); return 1; } @@ -35,3 +35,6 @@ if (size == mpp->size) { condlog(0, "%s: map is still the same size (%llu)", mapname, mpp->size); +-- +1.8.3.1 + diff --git a/0009-avoid-handling-paths-repeatedly-in-coalesce-paths.patch b/0006-avoid-handling-paths-repeatedly-in-coalesce-paths.patch similarity index 78% rename from 0009-avoid-handling-paths-repeatedly-in-coalesce-paths.patch rename to 0006-avoid-handling-paths-repeatedly-in-coalesce-paths.patch index 8d8e606b9736ae8c827cdb9553702df2f9534550..330bc4f4b0e8abbfd7d822aaba40267286d49e12 100644 --- a/0009-avoid-handling-paths-repeatedly-in-coalesce-paths.patch +++ b/0006-avoid-handling-paths-repeatedly-in-coalesce-paths.patch @@ -1,7 +1,7 @@ -From 6c79d35c3d351323d18b63d76450fcfbb6ef5b56 Mon Sep 17 00:00:00 2001 +From 2870e594978f683a97f32a8f9d8ed1747caae60e Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Tue, 22 Jan 2019 22:00:35 -0500 -Subject: [PATCH] Module: fix lun expansion failure when there is offline path +Subject: [PATCH] avoid handling paths repeatedly in coalesce paths reason:fix lun expansion failure when there is offline path --- @@ -12,10 +12,10 @@ reason:fix lun expansion failure when there is offline path 4 files changed, 14 insertions(+) diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 09c3dcf..1b1cc55 100644 +index 6fb477f..ff65c1b 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c -@@ -1021,6 +1021,7 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, +@@ -1166,6 +1166,7 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, vector_foreach_slot (pathvec, pp1, k) { int invalid; @@ -23,7 +23,7 @@ index 09c3dcf..1b1cc55 100644 /* skip this path for some reason */ /* 1. if path has no unique id or wwid blacklisted */ -@@ -1053,6 +1054,12 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, +@@ -1202,6 +1203,12 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, orphan_path(pp1, "only one path"); continue; } @@ -36,7 +36,7 @@ index 09c3dcf..1b1cc55 100644 /* * at this point, we know we really got a new mp -@@ -1071,6 +1078,10 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, +@@ -1220,6 +1227,10 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, for (i = k + 1; i < VECTOR_SIZE(pathvec); i++) { pp2 = VECTOR_SLOT(pathvec, i); @@ -48,10 +48,10 @@ index 09c3dcf..1b1cc55 100644 if (strcmp(pp1->wwid, pp2->wwid)) continue; diff --git a/libmultipath/structs.c b/libmultipath/structs.c -index ae847d6..99435c1 100644 +index 464596f..e5de0a7 100644 --- a/libmultipath/structs.c +++ b/libmultipath/structs.c -@@ -100,6 +100,7 @@ alloc_path (void) +@@ -101,6 +101,7 @@ alloc_path (void) pp->fd = -1; pp->tpgs = TPGS_UNDEF; pp->priority = PRIO_UNDEF; @@ -60,10 +60,10 @@ index ae847d6..99435c1 100644 checker_clear(&pp->checker); dm_path_to_gen(pp)->ops = &dm_gen_path_ops; diff --git a/libmultipath/structs.h b/libmultipath/structs.h -index 0a2623a..d667cb7 100644 +index 7de93d6..022ba12 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h -@@ -277,6 +277,7 @@ struct path { +@@ -280,6 +280,7 @@ struct path { struct checker checker; struct multipath * mpp; int fd; @@ -72,10 +72,10 @@ index 0a2623a..d667cb7 100644 int retriggers; unsigned int path_failures; diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index f87d69d..fba38c0 100644 +index 8895fa7..8676081 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c -@@ -388,6 +388,7 @@ int verify_paths(struct multipath *mpp, struct vectors *vecs) +@@ -738,6 +738,7 @@ int verify_paths(struct multipath *mpp) return 0; vector_foreach_slot (mpp->paths, pp, i) { diff --git a/0015-bugfix-lun-expansion-failure-when-there-is-offline-path.patch b/0007-bugfix-lun-expansion-failure-when-there-is-offline-path.patch similarity index 64% rename from 0015-bugfix-lun-expansion-failure-when-there-is-offline-path.patch rename to 0007-bugfix-lun-expansion-failure-when-there-is-offline-path.patch index 8586f3d916af212f0ab977e65e44a2bacd442830..e291b43c57c088d70880546565a8bc165dd81447 100644 --- a/0015-bugfix-lun-expansion-failure-when-there-is-offline-path.patch +++ b/0007-bugfix-lun-expansion-failure-when-there-is-offline-path.patch @@ -1,8 +1,18 @@ +From 5ebbef9c1f3ae72efe7f9582532a346227a0a1a3 Mon Sep 17 00:00:00 2001 +From: renmingshuai +Date: Thu, 28 Jan 2021 22:26:58 +0800 +Subject: [PATCH] fix lun expansion failure when there is offline path + +--- + libmultipath/configure.c | 20 +++++++++++++++----- + libmultipath/structs_vec.c | 5 +++-- + 2 files changed, 18 insertions(+), 7 deletions(-) + diff --git a/libmultipath/configure.c b/libmultipath/configure.c -index 1b1cc55..f66bd5b 100644 +index ff65c1b..e616da2 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c -@@ -1054,11 +1054,18 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, +@@ -1203,11 +1203,18 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, orphan_path(pp1, "only one path"); continue; } @@ -26,7 +36,7 @@ index 1b1cc55..f66bd5b 100644 /* -@@ -1086,6 +1093,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, +@@ -1235,6 +1242,9 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, if (strcmp(pp1->wwid, pp2->wwid)) continue; @@ -37,18 +47,21 @@ index 1b1cc55..f66bd5b 100644 mpp->size = pp2->size; diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index d85eb5f..6c42824 100644 +index 8676081..0300add 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c -@@ -394,8 +394,9 @@ int verify_paths(struct multipath *mpp, struct vectors *vecs) +@@ -742,8 +742,9 @@ int verify_paths(struct multipath *mpp) /* * see if path is in sysfs */ -- if (sysfs_attr_get_value(pp->udev, "dev", +- if (!pp->udev || sysfs_attr_get_value(pp->udev, "dev", - pp->dev_t, BLK_DEV_SIZE) < 0) { -+ if ((sysfs_attr_get_value(pp->udev, "dev", ++ if (!pp->udev || (sysfs_attr_get_value(pp->udev, "dev", + pp->dev_t, BLK_DEV_SIZE) < 0) || + (pp->state == PATH_DOWN && pp->size != mpp->size)) { if (pp->state != PATH_DOWN) { condlog(1, "%s: removing valid path %s in state %d", mpp->alias, pp->dev, pp->state); +-- +1.8.3.1 + diff --git a/0010-fix-bugs-backported-from-next-branch.patch b/0008-fix-bugs-backported-from-next-branch.patch similarity index 95% rename from 0010-fix-bugs-backported-from-next-branch.patch rename to 0008-fix-bugs-backported-from-next-branch.patch index f958d8c53de1c4e99d98dc0d0e4b370d584e87ef..916d2aad5a3255242013a89b17eff90df8b2857a 100644 --- a/0010-fix-bugs-backported-from-next-branch.patch +++ b/0008-fix-bugs-backported-from-next-branch.patch @@ -1,4 +1,4 @@ -From 96ebdd776e676d24ddb5c6c877e2e13ece1717b3 Mon Sep 17 00:00:00 2001 +From a4485f642dc3f07f9f61245f4a5de559d3193649 Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Wed, 23 Jan 2019 01:57:33 -0500 Subject: [PATCH] fix bugs backported from next branch @@ -118,10 +118,10 @@ index 88cac5f..075751c 100644 int getprio (struct path * pp, __attribute__((unused)) char *args, diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 38cf1e9..790143d 100644 +index 8895fa7..34ee661 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c -@@ -34,8 +34,10 @@ int update_mpp_paths(struct multipath *mpp, vector pathvec) +@@ -35,8 +35,10 @@ int update_mpp_paths(struct multipath *mpp, vector pathvec) return 0; if (!mpp->paths && @@ -134,10 +134,10 @@ index 38cf1e9..790143d 100644 vector_foreach_slot (mpp->pg, pgp, i) { vector_foreach_slot (pgp->paths, pp, j) { diff --git a/multipathd/main.c b/multipathd/main.c -index 23fb9d4..ef14750 100644 +index a4abbb2..12459ab 100644 --- a/multipathd/main.c +++ b/multipathd/main.c -@@ -1665,6 +1665,11 @@ enable_group(struct path * pp) +@@ -1725,6 +1725,11 @@ enable_group(struct path * pp) pgp = VECTOR_SLOT(pp->mpp->pg, pp->pgindex - 1); diff --git a/0008-multipathd-disable-queueing-for-recreated-map-in-uev.patch b/0008-multipathd-disable-queueing-for-recreated-map-in-uev.patch deleted file mode 100644 index 7c9d2a99166f640e4aa639163085b1911cebeac0..0000000000000000000000000000000000000000 --- a/0008-multipathd-disable-queueing-for-recreated-map-in-uev.patch +++ /dev/null @@ -1,55 +0,0 @@ -From eab6fcf772e91a16428e0f3262e6b4ef81705f79 Mon Sep 17 00:00:00 2001 -From: sunguoshuai -Date: Tue, 22 Jan 2019 21:29:56 -0500 -Subject: [PATCH] multipathd: disable queueing for recreated map in - uev_remove_map - -reason:disable queueing for recreated map in uev_remove_map ---- - multipathd/main.c | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/multipathd/main.c b/multipathd/main.c -index 8baf9ab..23fb9d4 100644 ---- a/multipathd/main.c -+++ b/multipathd/main.c -@@ -674,7 +674,7 @@ uev_add_map (struct uevent * uev, struct vectors * vecs) - char *alias; - int major = -1, minor = -1, rc; - -- condlog(3, "%s: add map (uevent)", uev->kernel); -+ condlog(2, "%s: add map (uevent)", uev->kernel); - alias = uevent_get_dm_name(uev); - if (!alias) { - condlog(3, "%s: No DM_NAME in uevent", uev->kernel); -@@ -793,7 +793,26 @@ uev_remove_map (struct uevent * uev, struct vectors * vecs) - uev->kernel, mpp->alias, alias); - goto out; - } -- -+ /* -+ * There may be a race window here: -+ * 1. all paths gone, causing map flushed both from multipathd and kernel -+ * 2. paths regenerated, causing multipathd creating the map again. -+ * 1 will generate a remove uevent which can be handled after 2, -+ * so we can disable queueing for the map created by 2 here temporarily -+ * and let the change uevent (generated by 2) calling uev_add_map -+ * ->setup_multipath to set queueing again. This can prevent -+ * the deadlock in this race window. -+ * -+ * The possible deadlock is: all udevd workers hangs in -+ * devices because of queue_if_no_path, so no udevd workers -+ * can handle new event and since multipathd will remove the map, -+ * the checkerloop cannot check this map's retry tick timeout -+ * and cancel the io hang which makes the udevd worker hang forever. -+ * multipathd cannot receive any uevent from udevd because all -+ * udevd workers hang there so the map cannot be recreated -+ * again which makes a deadlock. -+ */ -+ dm_queue_if_no_path(alias, 0); - remove_map_and_stop_waiter(mpp, vecs); - out: - lock_cleanup_pop(vecs->lock); --- -1.8.3.1 - diff --git a/0011-bugfix-fix-change-reservation-key-to-uint8-for-memcmp.patch b/0009-bugfix-change-reservation-key-to-uint8-for-memcmp.patch similarity index 77% rename from 0011-bugfix-fix-change-reservation-key-to-uint8-for-memcmp.patch rename to 0009-bugfix-change-reservation-key-to-uint8-for-memcmp.patch index bd31b37ee25c8193bdbd5dff6106271729f5f079..2b9f36689721f3b879cb06c244eae13c141a84a7 100644 --- a/0011-bugfix-fix-change-reservation-key-to-uint8-for-memcmp.patch +++ b/0009-bugfix-change-reservation-key-to-uint8-for-memcmp.patch @@ -1,8 +1,7 @@ -From aa3dbb9a4c7ba220139801533a27d99542d4e909 Mon Sep 17 00:00:00 2001 +From 30ea73e8896765854fdf845fbb12b6eb85531527 Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Wed, 23 Jan 2019 02:21:31 -0500 -Subject: [PATCH] fix change reservation key to uint8 for - memcmp +Subject: [PATCH] fix change reservation key to uint8 for memcmp reason:fix change reservation key to uint8 for memcmp --- @@ -10,10 +9,10 @@ reason:fix change reservation key to uint8 for memcmp 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c -index 691b4e1..a2907db 100644 +index 1f9817e..557d582 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c -@@ -263,6 +263,9 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, +@@ -249,6 +249,9 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, int ret; uint64_t prkey; struct config *conf; @@ -23,7 +22,7 @@ index 691b4e1..a2907db 100644 ret = mpath_get_map(fd, &alias, &mpp); if (ret != MPATH_PR_SUCCESS) -@@ -353,8 +356,15 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, +@@ -274,8 +277,15 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, } } diff --git a/0012-bugfix-ignore-for-clear-mismatch-key.patch b/0010-ignore-for-clear-mismatch-key.patch similarity index 88% rename from 0012-bugfix-ignore-for-clear-mismatch-key.patch rename to 0010-ignore-for-clear-mismatch-key.patch index 74d0471c25b3e2bcb6bfae30001017bdac03b5e3..ed320dde6e9476b285bd18358b9ed5d0882b007c 100644 --- a/0012-bugfix-ignore-for-clear-mismatch-key.patch +++ b/0010-ignore-for-clear-mismatch-key.patch @@ -1,4 +1,4 @@ -From ed732bcdc90162993e82df1bec8642aabb7a64a5 Mon Sep 17 00:00:00 2001 +From 70ff8a11623a0a0e7677c597b5fb1846149d7de3 Mon Sep 17 00:00:00 2001 From: sunguoshuai Date: Wed, 23 Jan 2019 02:38:00 -0500 Subject: [PATCH] ignore for clear mismatch key @@ -9,10 +9,10 @@ reason:ignore for clear mismatch key 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c -index f9c3be9..027d006 100644 +index 557d582..5a8c69d 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c -@@ -309,7 +309,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, +@@ -266,7 +266,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, if (mpp->prkey_source == PRKEY_SOURCE_FILE && prkey && ((!get_be64(mpp->reservation_key) && rq_servact == MPATH_PROUT_REG_SA) || @@ -22,7 +22,7 @@ index f9c3be9..027d006 100644 memcpy(&mpp->reservation_key, paramp->sa_key, 8); if (update_prkey_flags(alias, get_be64(mpp->reservation_key), paramp->sa_flags)) { -@@ -326,12 +327,16 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, +@@ -283,12 +284,16 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, uireservation >>= 8; } diff --git a/0013-bugfix-flush-and-sync-before-reboot.patch b/0011-bugfix-flush-and-sync-before-reboot.patch similarity index 61% rename from 0013-bugfix-flush-and-sync-before-reboot.patch rename to 0011-bugfix-flush-and-sync-before-reboot.patch index dd411848cfe4e7fe87e32da3645fae1da5bba46a..137758d391268c51c155e3695529efdf616c1101 100644 --- a/0013-bugfix-flush-and-sync-before-reboot.patch +++ b/0011-bugfix-flush-and-sync-before-reboot.patch @@ -1,8 +1,6 @@ -diff --git a/libmultipath/util.c b/libmultipath/util.c -index 8d8fcc8..3c284b7 100644 --- a/libmultipath/util.c +++ b/libmultipath/util.c -@@ -463,5 +463,12 @@ int safe_write(int fd, const void *buf, size_t count) +@@ -368,6 +368,13 @@ int safe_write(int fd, const void *buf, size_t count) count -= r; buf = (const char *)buf + r; } @@ -15,3 +13,7 @@ index 8d8fcc8..3c284b7 100644 + return 0; } + +-- +1.8.3.1 + diff --git a/0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch b/0012-change-log-level-to-info-if-alua-is-not-support-by-s.patch similarity index 70% rename from 0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch rename to 0012-change-log-level-to-info-if-alua-is-not-support-by-s.patch index 6a0944ae5dfd8f8232a3dd30cb32b20dcbc2e5ea..7d15df4826e023ca8f81307d431e905e16b3716c 100644 --- a/0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch +++ b/0012-change-log-level-to-info-if-alua-is-not-support-by-s.patch @@ -1,18 +1,18 @@ -From 0008a2343765ab689cfc66acd8fc84630611d796 Mon Sep 17 00:00:00 2001 +From a0cb1bf53c2a2b4089b98d3c811845517c95c6f5 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 22 Mar 2019 19:37:43 +0800 -Subject: [PATCH 1/5] change log level to info if alua is not support by - storage server +Subject: [PATCH] change log level to info if alua is not support by storage + server --- libmultipath/prioritizers/alua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/prioritizers/alua.c b/libmultipath/prioritizers/alua.c -index 1400b11..6b69982 100644 +index e65b6f5..97eb152 100644 --- a/libmultipath/prioritizers/alua.c +++ b/libmultipath/prioritizers/alua.c -@@ -127,7 +127,7 @@ int getprio (struct path * pp, char * args, unsigned int timeout) +@@ -130,7 +130,7 @@ int getprio (struct path * pp, char * args, unsigned int timeout) } else { switch(-rc) { case ALUA_PRIO_NOT_SUPPORTED: @@ -22,5 +22,5 @@ index 1400b11..6b69982 100644 break; case ALUA_PRIO_RTPG_FAILED: -- -2.19.1 +1.8.3.1 diff --git a/0019-fix-find-multipath-failure.patch b/0013-fix-find-multipath-failure.patch similarity index 100% rename from 0019-fix-find-multipath-failure.patch rename to 0013-fix-find-multipath-failure.patch diff --git a/0020-change-kpartx-file-and-default-bindir.patch b/0014-kpartx-change-kpartx-file-and-default-bindir.patch similarity index 82% rename from 0020-change-kpartx-file-and-default-bindir.patch rename to 0014-kpartx-change-kpartx-file-and-default-bindir.patch index f3ef96bbe95a3347879eb66572d174a72b976670..c899528f61523ec996f9d9ad47c7b3e596428d6a 100644 --- a/0020-change-kpartx-file-and-default-bindir.patch +++ b/0014-kpartx-change-kpartx-file-and-default-bindir.patch @@ -1,4 +1,4 @@ -From 768883da9969b76aade3e16d4a5b8cec47d6f30e Mon Sep 17 00:00:00 2001 +From 57e2c5ddceb461c00bc42c8cb2fd45665838e6d1 Mon Sep 17 00:00:00 2001 From: wangjufeng Date: Fri, 10 Jan 2020 11:57:08 +0800 Subject: [PATCH] kpartx: change kpartx file and default bindir @@ -13,10 +13,10 @@ Signed-off-by: wangjufeng 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc b/Makefile.inc -index af2f5ba..e6466ee 100644 +index f4d895d..0b083eb 100644 --- a/Makefile.inc +++ b/Makefile.inc -@@ -49,7 +49,7 @@ ifndef SYSTEMDPATH +@@ -51,7 +51,7 @@ ifndef SYSTEMDPATH endif prefix = @@ -26,10 +26,10 @@ index af2f5ba..e6466ee 100644 bindir = $(exec_prefix)/sbin libudevdir = $(prefix)/$(SYSTEMDPATH)/udev diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules -index 8f99049..8a3a171 100644 +index d7527d7..0e0d70d 100644 --- a/kpartx/kpartx.rules +++ b/kpartx/kpartx.rules -@@ -32,6 +32,6 @@ LABEL="mpath_kpartx_end" +@@ -36,6 +36,6 @@ LABEL="mpath_kpartx_end" GOTO="kpartx_end" LABEL="run_kpartx" diff --git a/0014-bugfix-RH-remove-local-disk-from-pathvec.patch b/0015-bugfix-RH-remove-local-disk-from-pathvec.patch similarity index 70% rename from 0014-bugfix-RH-remove-local-disk-from-pathvec.patch rename to 0015-bugfix-RH-remove-local-disk-from-pathvec.patch index 7be4ad725a3c8dce7653c5f46b331ed7b74694d8..2510c367709f650d12525887b2ba474e849ad708 100644 --- a/0014-bugfix-RH-remove-local-disk-from-pathvec.patch +++ b/0015-bugfix-RH-remove-local-disk-from-pathvec.patch @@ -1,23 +1,23 @@ -From a1461cbfa7ea2bccef20eb2f5275648452ee050c Mon Sep 17 00:00:00 2001 +From a448fe41073d613764b8988d1e22ee0c6e7e3f92 Mon Sep 17 00:00:00 2001 From: chenminhua Date: Mon, 2 Apr 2018 04:01:04 -0400 -Subject: [PATCH] 1hostos-patch-upgrade:0330 hotpatch modify +Subject: [PATCH] remove local path [Changelog]:add upgrade path [Author]:chenminhua --- - libmultipath/discovery.c | 124 +++++++++++++++++++++++++++++++++++++++++++++-- + libmultipath/discovery.c | 128 ++++++++++++++++++++++++++++++++++++++++++++--- libmultipath/discovery.h | 1 + multipathd/main.c | 4 ++ - 3 files changed, 124 insertions(+), 5 deletions(-) + 3 files changed, 127 insertions(+), 6 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index ee3290c..c49848e 100644 +index c2e1754..24e9b50 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c -@@ -34,6 +34,103 @@ - #include "prioritizers/alua_rtpg.h" - #include "foreign.h" +@@ -36,6 +36,103 @@ + #include "configure.h" + #include "print.h" +const char *conf_file = "/etc/multipath_private.conf"; +static int conf_file_parsed = 0; @@ -119,55 +119,61 @@ index ee3290c..c49848e 100644 struct vpd_vendor_page vpd_vendor_pages[VPD_VP_ARRAY_SIZE] = { [VPD_VP_UNDEF] = { 0x00, "undef" }, [VPD_VP_HP3PAR] = { 0xc0, "hp3par" }, -@@ -124,6 +221,7 @@ path_discover (vector pathvec, struct config * conf, +@@ -127,22 +224,35 @@ path_discover (vector pathvec, struct config * conf, { - struct path * pp; - const char * devname; + struct path *pp; + char devt[BLK_DEV_SIZE]; + int err = 1; + dev_t devnum = udev_device_get_devnum(udevice); - devname = udev_device_get_sysname(udevice); - if (!devname) -@@ -137,12 +235,22 @@ path_discover (vector pathvec, struct config * conf, - snprintf(devt, BLK_DEV_SIZE, "%d:%d", - major(devnum), minor(devnum)); - pp = find_path_by_devt(pathvec, devt); -- if (!pp) -- return store_pathinfo(pathvec, conf, -- udevice, flag | DI_BLACKLIST, -- NULL); -+ if (!pp) { -+ err = store_pathinfo(pathvec, conf, -+ udevice, flag, &pp); -+ if (err == 1) -+ return 1; -+ if (err == 0) -+ remove_local_path(pathvec, pp); -+ return 0; -+ } - } -- return pathinfo(pp, conf, flag); -+ err = pathinfo(pp, conf, flag); -+ if (err) + snprintf(devt, BLK_DEV_SIZE, "%d:%d", + major(devnum), minor(devnum)); + pp = find_path_by_devt(pathvec, devt); +- if (!pp) +- return store_pathinfo(pathvec, conf, +- udevice, flag | DI_BLACKLIST, +- NULL); +- else ++ if (!pp) { ++ err = store_pathinfo(pathvec, conf, ++ udevice, flag | DI_BLACKLIST, ++ &pp); ++ if (err == 1) ++ return 1; ++ if (err == 0) ++ remove_local_path(pathvec, pp); ++ return 0; ++ } ++ else { + /* + * Don't use DI_BLACKLIST on paths already in pathvec. We rely + * on the caller to pre-populate the pathvec with valid paths + * only. + */ +- return pathinfo(pp, conf, flag); ++ err = pathinfo(pp, conf, flag); ++ if (err) ++ return err; ++ ++ remove_local_path(pathvec, pp); + return err; -+ -+ remove_local_path(pathvec, pp); -+ return err; ++ } } static void cleanup_udev_enumerate_ptr(void *arg) -@@ -2091,6 +2199,12 @@ int pathinfo(struct path *pp, struct config *conf, int mask) - +@@ -2138,6 +2248,12 @@ int pathinfo(struct path *pp, struct config *conf, int mask) if (rc != PATHINFO_OK) return rc; -+ + + /* free local device */ + if (transport(pp->sg_id.host_no)) { + condlog(3, "%s is a local device", pp->dev); + return 0; + } - } - - if (mask & DI_BLACKLIST && mask & DI_SYSFS) { ++ + if (pp->bus == SYSFS_BUS_SCSI && + pp->sg_id.proto_id == SCSI_PROTOCOL_USB && + !conf->allow_usb_devices) { diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index 6444887..a438b44 100644 --- a/libmultipath/discovery.h @@ -181,10 +187,10 @@ index 6444887..a438b44 100644 /* * discovery bitmask diff --git a/multipathd/main.c b/multipathd/main.c -index ef14750..41c4258 100644 +index 12459ab..0b572ee 100644 --- a/multipathd/main.c +++ b/multipathd/main.c -@@ -943,6 +943,10 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) +@@ -964,6 +964,10 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) int start_waiter = 0; int ret; diff --git a/0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch b/0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch similarity index 69% rename from 0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch rename to 0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch index 75654db1c2083471067977680b20109c40048da1..e902a88170fb38cd38f32d992af0ea7259e9e15c 100644 --- a/0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch +++ b/0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch @@ -1,4 +1,4 @@ -From 4ac8e63deadf125004eacbc76859cfa7a46e1e16 Mon Sep 17 00:00:00 2001 +From dd0c8768be8605040100cf8260f6b1405c264ffe Mon Sep 17 00:00:00 2001 From: root Date: Fri, 22 Mar 2019 19:48:35 +0800 Subject: [PATCH] clear mpp path reference when path is freed, otherwise double @@ -13,14 +13,14 @@ call stack: --- libmultipath/discovery.c | 10 ++++++---- libmultipath/discovery.h | 2 +- - multipathd/main.c | 23 ++++++++++++++++++++++- - 3 files changed, 29 insertions(+), 6 deletions(-) + multipathd/main.c | 24 +++++++++++++++++++++++- + 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index c49848e..2458bf5 100644 +index 24e9b50..b5cbc88 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c -@@ -112,7 +112,7 @@ transport (int h) +@@ -114,7 +114,7 @@ transport (int h) } int @@ -29,7 +29,7 @@ index c49848e..2458bf5 100644 { int i = -1; -@@ -127,7 +127,9 @@ remove_local_path (vector pathvec, struct path *pp) +@@ -129,7 +129,9 @@ remove_local_path (vector pathvec, struct path *pp) if ((i = find_slot(pathvec, (void *)pp)) != -1) { vector_del_slot(pathvec, i); } @@ -40,24 +40,24 @@ index c49848e..2458bf5 100644 return 0; } -@@ -241,7 +243,7 @@ path_discover (vector pathvec, struct config * conf, - if (err == 1) - return 1; - if (err == 0) -- remove_local_path(pathvec, pp); -+ remove_local_path(pathvec, pp, 1); - return 0; - } +@@ -237,7 +239,7 @@ path_discover (vector pathvec, struct config * conf, + if (err == 1) + return 1; + if (err == 0) +- remove_local_path(pathvec, pp); ++ remove_local_path(pathvec, pp, 1); + return 0; } -@@ -249,7 +251,7 @@ path_discover (vector pathvec, struct config * conf, - if (err) + else { +@@ -250,7 +252,7 @@ path_discover (vector pathvec, struct config * conf, + if (err) + return err; + +- remove_local_path(pathvec, pp); ++ remove_local_path(pathvec, pp, 1); return err; - -- remove_local_path(pathvec, pp); -+ remove_local_path(pathvec, pp, 1); - return err; + } } - diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index a438b44..ab73493 100644 --- a/libmultipath/discovery.h @@ -72,10 +72,10 @@ index a438b44..ab73493 100644 /* * discovery bitmask diff --git a/multipathd/main.c b/multipathd/main.c -index 41c4258..09ea102 100644 +index 0b572ee..a10eba0 100644 --- a/multipathd/main.c +++ b/multipathd/main.c -@@ -841,6 +841,21 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs) +@@ -813,6 +813,21 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs) return flush_map(mpp, vecs, 0); } @@ -97,7 +97,7 @@ index 41c4258..09ea102 100644 static int uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map) { -@@ -883,6 +898,7 @@ uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map) +@@ -904,6 +919,7 @@ uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map) i = find_slot(vecs->pathvec, (void *)pp); if (i != -1) vector_del_slot(vecs->pathvec, i); @@ -105,7 +105,7 @@ index 41c4258..09ea102 100644 free_path(pp); } else { condlog(0, "%s: failed to reinitialize path", -@@ -944,8 +960,11 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) +@@ -965,8 +981,11 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) int ret; /* if pp is local path,remove it and return 0. */ @@ -118,7 +118,7 @@ index 41c4258..09ea102 100644 /* * need path UID to go any further -@@ -960,6 +979,7 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) +@@ -981,6 +1000,7 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map) int i = find_slot(vecs->pathvec, (void *)pp); if (i != -1) vector_del_slot(vecs->pathvec, i); @@ -126,14 +126,15 @@ index 41c4258..09ea102 100644 free_path(pp); return 1; } -@@ -1205,6 +1225,7 @@ out: - if ((i = find_slot(vecs->pathvec, (void *)pp)) != -1) - vector_del_slot(vecs->pathvec, i); - -+ clear_ref_from_mpp(pp, vecs); - free_path(pp); - - return retval; +@@ -1242,6 +1262,8 @@ ev_remove_path (struct path *pp, struct vectors * vecs, int need_do_map) + /* mpp == NULL */ + if ((i = find_slot(vecs->pathvec, (void *)pp)) != -1) + vector_del_slot(vecs->pathvec, i); ++ ++ clear_ref_from_mpp(pp, vecs); + free_path(pp); + } + out: -- 1.8.3.1 diff --git a/0018-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch b/0018-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch deleted file mode 100644 index b94500300842157e30cbe17e805a55f7fee5092b..0000000000000000000000000000000000000000 --- a/0018-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch +++ /dev/null @@ -1,87 +0,0 @@ -From db72d840682d15abb2e6694704a91200e513dbac Mon Sep 17 00:00:00 2001 -From: root -Date: Fri, 22 Mar 2019 20:33:53 +0800 -Subject: [PATCH 5/5] libmultipath: fix memory leak in disassemble_map - ---- - libmultipath/dmparser.c | 12 ++++++++++-- - libmultipath/structs_vec.c | 10 ++++++++++ - 2 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c -index 620f507..1558c4e 100644 ---- a/libmultipath/dmparser.c -+++ b/libmultipath/dmparser.c -@@ -142,6 +142,7 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, - int def_minio = 0; - struct path * pp; - struct pathgroup * pgp; -+ int pp_unfound; - - p = params; - -@@ -291,6 +292,7 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, - char devname[FILE_NAME_SIZE]; - - pp = NULL; -+ pp_unfound = 0; - p += get_word(p, &word); - - if (!word) -@@ -310,6 +312,7 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, - } - - if (!pp) { -+ pp_unfound = 1; - pp = alloc_path(); - - if (!pp) -@@ -322,8 +325,10 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, - WWID_SIZE); - } - /* Only call this in multipath client mode */ -- if (!is_daemon && store_path(pathvec, pp)) -+ if (!is_daemon && store_path(pathvec, pp)) { -+ free_path(pp); - goto out1; -+ } - } else { - if (!strlen(pp->wwid) && - strlen(mpp->wwid)) -@@ -332,8 +337,11 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, - } - FREE(word); - -- if (store_path(pgp->paths, pp)) -+ if (store_path(pgp->paths, pp)) { -+ if (pp_unfound) -+ free_path(pp); - goto out; -+ } - - /* - * Update wwid for multipaths which are not setup -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 6c42824..828aef2 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -252,6 +252,16 @@ void sync_paths(struct multipath *mpp, vector pathvec) - update_mpp_paths(mpp, pathvec); - vector_foreach_slot (mpp->paths, pp, i) - pp->mpp = mpp; -+ -+ vector_foreach_slot (mpp->pg, pgp, i) { -+ vector_foreach_slot (pgp->paths, pp, j) { -+ if ((find_slot(mpp->paths, pp) == -1) \ -+ && (find_slot(pathvec, pp) == -1)) { -+ vector_del_slot(pgp->paths, j--); -+ free_path(pp); -+ } -+ } -+ } - } - - int --- -2.19.1 - diff --git a/0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch b/0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch deleted file mode 100644 index f539701336f4d791c8e023456648ff8a47ba52bf..0000000000000000000000000000000000000000 --- a/0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 7aa405ce7decd3609bcb76fa72a0ebe17ef3a635 Mon Sep 17 00:00:00 2001 -From: lixiaokeng -Date: Mon, 13 Jul 2020 13:07:40 +0200 -Subject: [PATCH 1/4] master - libmultipath: fix use after free when iscsi logs - in - -When two iscsi ips log in and out alternately and the following scripts run -at the same time, - -#!/bin/bash -interval=5 -while true -do - iscsiadm -m node -p 9.41.147.171 &> /dev/null - iscsiadm -m node -p 9.41.148.172 &> /dev/null - iscsiadm -m session &> /dev/null - rescan-scsi-bus.sh &> /dev/null - multipath -v2 &> /dev/null - multipath -ll &> /dev/null - sleep $interval -done - -multipathd will have a segfault after about 30 mins. - -The reason is that mpp->hwe is accessed after hwe is already freed. In -extract_hwe_from_path func, mpp->hwe is set to pp->hwe, so they points to the -same hwe. For some reasons, pp->mpp will be set to NULL in orphan_path func. -Then, pp and hwe will be freed with (pp->mpp == NULL) in free_path func -called by ev_remove_path func. However, mpp->hwe is not set to NULL while hwe -is already freed. So, when iscsi device logs in and new path is added to mpp, -mpp->hwe will be accessed in select_pgfailback func. Finally, use-after-free -problem occurs. - -The procedure details given as follows, -1.wait_dmevents thread -wait_dmevents - ->dmevent_loop - ->update_multipath - ->__setup_multipath - ->update_multipath_strings - -> sync_paths - ->orphan_path -2.uevqloop thread (iscsi log out, remove path) -uevqloop -->uevent_dispatch - ->service_uevq - ->uev_remove_path - ->ev_remove_path //pp->mpp is NULL - ->free_path(pp) - //pp->hew are freed but mpp->hwe is not set to NULL -3.ev_remove_path (iscsi log in, add path) -uevqloop -->uevent_dispatch - ->service_uevq - ->ev_add_path - ->select_pgfailback //mpp->hwe is accessed - -Here, we will set mpp->hwe to NULL before setting pp->map to NULL in orphan_path -func. - -Signed-off-by: Tianxiong Lu -Signed-off-by: lixiaokeng -Signed-off-by: Zhiqiang Liu -Signed-off-by: Martin Wilck ---- - libmultipath/structs_vec.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 8137ea2..430eaad 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -93,6 +93,8 @@ int adopt_paths(vector pathvec, struct multipath *mpp) - void orphan_path(struct path *pp, const char *reason) - { - condlog(3, "%s: orphan path, %s", pp->dev, reason); -+ if (pp->mpp && pp->mpp->hwe == pp->hwe) -+ pp->mpp->hwe = NULL; - pp->mpp = NULL; - pp->dmstate = PSTATE_UNDEF; - pp->uid_attribute = NULL; --- -1.8.3.1 - diff --git a/0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch b/0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch deleted file mode 100644 index 30a064a3a440bd4c5dc43606144f04c2a16e8e40..0000000000000000000000000000000000000000 --- a/0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c44d769bbca83b7dfe643712cc783db852a41b87 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 13 Jul 2020 13:07:41 +0200 -Subject: [PATCH 2/4] libmultipath: warn if freeing path that holds mpp->hwe - -This just adds an error message to the previous patch. - -Signed-off-by: Martin Wilck ---- - libmultipath/structs_vec.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index 430eaad..cde4dbe 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -93,8 +93,11 @@ int adopt_paths(vector pathvec, struct multipath *mpp) - void orphan_path(struct path *pp, const char *reason) - { - condlog(3, "%s: orphan path, %s", pp->dev, reason); -- if (pp->mpp && pp->mpp->hwe == pp->hwe) -+ 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; - pp->dmstate = PSTATE_UNDEF; - pp->uid_attribute = NULL; --- -1.8.3.1 - diff --git a/0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch b/0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch deleted file mode 100644 index 48b3291b7698a5a0070dd0f3d16b04cafd19816e..0000000000000000000000000000000000000000 --- a/0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1b21582e297d449918ea29bec2b3a0b7ba8fa84c Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 13 Jul 2020 13:07:42 +0200 -Subject: [PATCH 3/4] libmultipath: warn about NULL value of mpp->hwe - -mpp->hwe is only accessed in propsel.c. It may become unset if -all paths of the mpp have been deleted. Access to mpp->hwe in this -case should be avoided. - -Signed-off-by: Martin Wilck ---- - libmultipath/propsel.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c -index d362beb..6822827 100644 ---- a/libmultipath/propsel.c -+++ b/libmultipath/propsel.c -@@ -65,7 +65,9 @@ do { \ - __do_set_from_vec(struct hwentry, var, (src)->hwe, dest) - - #define do_set_from_hwe(var, src, dest, msg) \ -- if (__do_set_from_hwe(var, src, dest)) { \ -+ if (!src->hwe) { \ -+ condlog(0, "BUG: do_set_from_hwe called with hwe == NULL"); \ -+ } else if (__do_set_from_hwe(var, src, dest)) { \ - origin = msg; \ - goto out; \ - } --- -1.8.3.1 - diff --git a/0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch b/0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch deleted file mode 100644 index 81c4eaabbb91e03ca24c3b6c40f841fcc0d1e7e8..0000000000000000000000000000000000000000 --- a/0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 44292f529f6c50e1abbab04acf7f0169094bdf24 Mon Sep 17 00:00:00 2001 -From: Martin Wilck -Date: Mon, 13 Jul 2020 13:07:43 +0200 -Subject: [PATCH 4/4] libmultipath: fix mpp->hwe handling in sync_paths() - -This is anologous to - -1f96269 ("multipathd: fix mpp->hwe handling on path removal") -f6839eb ("multipathd: fix mpp->hwe handling when paths are freed") - -When paths are removed from a map, we need to make sure that -mpp->hwe doesn't become stale. - -Reported-by: Lixiaokeng -Signed-off-by: Martin Wilck ---- - libmultipath/structs_vec.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c -index cde4dbe..ede1429 100644 ---- a/libmultipath/structs_vec.c -+++ b/libmultipath/structs_vec.c -@@ -260,6 +260,8 @@ void sync_paths(struct multipath *mpp, vector pathvec) - } - 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"); - } -@@ -267,6 +269,8 @@ void sync_paths(struct multipath *mpp, vector pathvec) - update_mpp_paths(mpp, pathvec); - vector_foreach_slot (mpp->paths, pp, i) - pp->mpp = mpp; -+ if (mpp->hwe == NULL) -+ extract_hwe_from_path(mpp); - - vector_foreach_slot (mpp->pg, pgp, i) { - vector_foreach_slot (pgp->paths, pp, j) { --- -1.8.3.1 - diff --git a/0025-fix-boolean-value-with-json-c-0.14.patch b/0025-fix-boolean-value-with-json-c-0.14.patch deleted file mode 100644 index cbfc8c5917903b9d7490df568249e8c5793e3a3a..0000000000000000000000000000000000000000 --- a/0025-fix-boolean-value-with-json-c-0.14.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 82129852d74785267f95ef598ac483ff9af38a55 Mon Sep 17 00:00:00 2001 -From: "mail@eworm.de" -Date: Sat, 25 Apr 2020 21:11:13 +0200 -Subject: [PATCH] fix boolean value with json-c 0.14 - -Upstream json-c removed the TRUE and FALSE defines in commit -0992aac61f8b087efd7094e9ac2b84fa9c040fcd. - -[mwilck]: Use stdbool.h, and keep the log message unchanged. - -Signed-off-by: Christian Hesse -Signed-off-by: Martin Wilck ---- - libdmmp/libdmmp_private.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h -index ac85b63..b1a6dde 100644 ---- a/libdmmp/libdmmp_private.h -+++ b/libdmmp/libdmmp_private.h -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - - #include "libdmmp/libdmmp.h" -@@ -82,7 +83,7 @@ static out_type func_name(struct dmmp_context *ctx, const char *var_name) { \ - do { \ - json_type j_type = json_type_null; \ - json_object *j_obj_tmp = NULL; \ -- if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != TRUE) { \ -+ if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != true) { \ - _error(ctx, "Invalid JSON output from multipathd IPC: " \ - "key '%s' not found", key); \ - rc = DMMP_ERR_IPC_ERROR; \ --- -1.8.3.1 - diff --git a/multipath-tools-0.8.5.tgz b/multipath-tools-0.8.5.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d1c7bc6fbfd9f4f6606ea9821b77497375e37355 Binary files /dev/null and b/multipath-tools-0.8.5.tgz differ diff --git a/multipath-tools-d491591.tgz b/multipath-tools-d491591.tgz deleted file mode 100644 index 3c7963df4c1b6178f991c31a6515e582a910e607..0000000000000000000000000000000000000000 Binary files a/multipath-tools-d491591.tgz and /dev/null differ diff --git a/multipath-tools.spec b/multipath-tools.spec index 06d758cef9f4d79aa268d123c08cc668b1ee408a..e40d8ba58b90b3940d0b4e9131b4e0b31a502359 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -1,38 +1,29 @@ Name: multipath-tools -Version: 0.8.4 -Release: 4 +Version: 0.8.5 +Release: 1 Summary: Tools to manage multipath devices with the device-mapper License: GPLv2-or-later and LGPLv2+ URL: http://christophe.varoqui.free.fr/ -# curl "https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=snapshot;h=d4915917655b3d205aa0e339ca13080ed8182d0d;sf=tgz" -o multipath-tools-d491591.tgz -Source0: multipath-tools-d491591.tgz +# curl https://github.com/opensvc/multipath-tools/archive/0.8.5.tar.gz -o multipath-tools-0.8.5.tgz +Source0: multipath-tools-0.8.5.tgz Source1: multipath.conf -Patch1: 0001-change-order-of-multipath.rules.patch -Patch2: 0002-libmpathpersist-depend-on-libmultipath.patch -Patch3: 0003-libmultipath-assign-variable-to-make-gcc-happy.patch -Patch4: 0004-RH-add-mpathconf.patch -Patch5: 0005-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch6: 0006-fix-syntax-error.patch -Patch7: 0007-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch -Patch8: 0008-multipathd-disable-queueing-for-recreated-map-in-uev.patch -Patch9: 0009-avoid-handling-paths-repeatedly-in-coalesce-paths.patch -Patch10: 0010-fix-bugs-backported-from-next-branch.patch -Patch11: 0011-bugfix-fix-change-reservation-key-to-uint8-for-memcmp.patch -Patch12: 0012-bugfix-ignore-for-clear-mismatch-key.patch -Patch13: 0013-bugfix-flush-and-sync-before-reboot.patch -Patch14: 0014-bugfix-RH-remove-local-disk-from-pathvec.patch -Patch15: 0015-bugfix-lun-expansion-failure-when-there-is-offline-path.patch -Patch16: 0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch -Patch17: 0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch -Patch18: 0018-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch -Patch19: 0019-fix-find-multipath-failure.patch -Patch20: 0020-change-kpartx-file-and-default-bindir.patch -Patch21: 0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch -Patch22: 0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch -Patch23: 0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch -Patch24: 0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch -Patch25: 0025-fix-boolean-value-with-json-c-0.14.patch +Patch1: 0001-change-order-of-multipath.rules.patch +Patch2: 0002-RH-add-mpathconf.patch +Patch3: 0003-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch4: 0004-fix-syntax-error.patch +Patch5: 0005-fix-multipathd-resize-when-not-all-paths-size-are-equal.patch +Patch6: 0006-avoid-handling-paths-repeatedly-in-coalesce-paths.patch +Patch7: 0007-bugfix-lun-expansion-failure-when-there-is-offline-path.patch +Patch8: 0008-fix-bugs-backported-from-next-branch.patch +Patch9: 0009-bugfix-change-reservation-key-to-uint8-for-memcmp.patch +Patch10: 0010-ignore-for-clear-mismatch-key.patch +Patch11: 0011-bugfix-flush-and-sync-before-reboot.patch +Patch12: 0012-change-log-level-to-info-if-alua-is-not-support-by-s.patch +Patch13: 0013-fix-find-multipath-failure.patch +Patch14: 0014-kpartx-change-kpartx-file-and-default-bindir.patch +Patch15: 0015-bugfix-RH-remove-local-disk-from-pathvec.patch +Patch16: 0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89 BuildRequires: libselinux-devel, libsepol-devel, readline-devel, ncurses-devel, git BuildRequires: systemd-units, systemd-devel, json-c-devel, perl-interpreter, pkgconfig @@ -88,7 +79,7 @@ Summary: Create device maps from partition tables. Reads partition tables and create device maps over partitions segments detected. %prep -%autosetup -Sgit -n multipath-tools-d491591 +%autosetup -Sgit -n multipath-tools-0.8.5 cp %{SOURCE1} . %build @@ -127,7 +118,7 @@ fi %files -%doc README README.alua multipath.conf +%doc README.md README.alua multipath.conf %license LICENSES/GPL-2.0 LICENSES/LGPL-2.0 LICENSES/GPL-3.0 %{_unitdir}/* /usr/sbin/multipath @@ -147,7 +138,7 @@ fi %files devel -%doc README +%doc README.md %{_includedir}/*.h %dir %{_includedir}/libdmmp %{_includedir}/libdmmp/* @@ -163,7 +154,7 @@ fi %files -n kpartx %license LICENSES/GPL-2.0 -%doc README +%doc README.md /usr/sbin/kpartx /usr/lib/udev/kpartx_id %config /usr/lib/udev/rules.d/11-dm-parts.rules @@ -172,6 +163,9 @@ fi %changelog +* Sat Jan 30 2020 lixiaokeng - 0.8.5-1 +- update to 0.8.5 + * Fri Oct 16 2020 lixiaokeng - 0.8.4-4 - Type:bugfix - ID:NA