From 5a1cfb90630759acd739e52d9a24da991ff4b505 Mon Sep 17 00:00:00 2001 From: lixiaokeng Date: Fri, 16 Oct 2020 16:55:23 +0800 Subject: [PATCH] remove patch that has been fix in 0.8.4 --- ...-to-info-if-alua-is-not-support-by-s.patch | 0 ...mory-leaks-issues-in-libmpathpersist.patch | 129 ------------ ...eference-when-path-is-freed-otherwis.patch | 139 +++++++++++++ ...eference-when-path-is-freed-otherwis.patch | 192 +++++++----------- ...h-fix-memory-leak-in-disassemble_map.patch | 87 -------- ...h => 0019-fix-find-multipath-failure.patch | 0 ...hange-kpartx-file-and-default-bindir.patch | 0 ...ath-fix-use-after-free-when-iscsi-lo.patch | 0 ...n-if-freeing-path-that-holds-mpp-hwe.patch | 0 ...ath-warn-about-NULL-value-of-mpp-hwe.patch | 0 ...h-fix-mpp-hwe-handling-in-sync_paths.patch | 0 ...5-fix-boolean-value-with-json-c-0.14.patch | 0 multipath-tools.spec | 27 ++- 13 files changed, 225 insertions(+), 349 deletions(-) rename 0017-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch => 0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch (100%) delete mode 100644 0016-bugfix-some-memory-leaks-issues-in-libmpathpersist.patch create mode 100644 0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch delete mode 100644 0019-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch rename 0020-fix-find-multipath-failure.patch => 0019-fix-find-multipath-failure.patch (100%) rename 0021-change-kpartx-file-and-default-bindir.patch => 0020-change-kpartx-file-and-default-bindir.patch (100%) rename 0022-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch => 0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch (100%) rename 0023-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch => 0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch (100%) rename 0024-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch => 0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch (100%) rename 0025-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch => 0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch (100%) rename 0026-fix-boolean-value-with-json-c-0.14.patch => 0025-fix-boolean-value-with-json-c-0.14.patch (100%) diff --git a/0017-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch b/0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch similarity index 100% rename from 0017-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch rename to 0016-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch diff --git a/0016-bugfix-some-memory-leaks-issues-in-libmpathpersist.patch b/0016-bugfix-some-memory-leaks-issues-in-libmpathpersist.patch deleted file mode 100644 index abb01fe..0000000 --- a/0016-bugfix-some-memory-leaks-issues-in-libmpathpersist.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 3142e137afb8dd2bd99398d05b3c24ac9a9fd68e Mon Sep 17 00:00:00 2001 -From: "wangjun196@huawei.com" -Date: Thu, 16 Jul 2020 18:03:30 +0800 -Subject: [PATCH] 1 - ---- - libmpathpersist/mpath_persist.c | 12 ++++++++++-- - libmpathpersist/mpath_pr_ioctl.c | 28 ++++++++++++++-------------- - 2 files changed, 24 insertions(+), 16 deletions(-) - -diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c -index 3da7a6c..0ae504e 100644 ---- a/libmpathpersist/mpath_persist.c -+++ b/libmpathpersist/mpath_persist.c -@@ -244,10 +244,14 @@ static int mpath_get_map(int fd, char **palias, struct multipath **pmpp) - - if (dm_map_present(alias) && dm_is_mpath(alias) != 1){ - condlog(3, "%s: not a multipath device.", alias); -+ if (curmp) -+ vector_free(curmp); -+ if (pathvec) -+ vector_free(pathvec); - goto out; - } - -- /* get info of all paths from the dm device */ -+ /* get info of all paths from the dm device */ - if (get_mpvec(curmp, pathvec, alias)){ - condlog(0, "%s: failed to get device info.", alias); - goto out; -@@ -823,7 +827,7 @@ out: - return (status); - } - --void * mpath_alloc_prin_response(int prin_sa) -+void *mpath_alloc_prin_response(int prin_sa) - { - void * ptr = NULL; - int size=0; -@@ -846,6 +850,10 @@ void * mpath_alloc_prin_response(int prin_sa) - if (size > 0) - { - ptr = calloc(size, 1); -+ if (!ptr) { -+ condlog (0, "failed to allocate MPATH_PRIN_RFSTAT_SA buffer"); -+ return NULL; -+ } - } - return ptr; - } -diff --git a/libmpathpersist/mpath_pr_ioctl.c b/libmpathpersist/mpath_pr_ioctl.c -index 74b26b0..8a78693 100644 ---- a/libmpathpersist/mpath_pr_ioctl.c -+++ b/libmpathpersist/mpath_pr_ioctl.c -@@ -23,8 +23,8 @@ - #define MAXRETRY 5 - - int prin_do_scsi_ioctl(char * dev, int rq_servact, struct prin_resp *resp, int noisy); --int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr, -- SenseData_t *Sensedata); -+int mpath_translate_response (const char * dev, struct sg_io_hdr *io_hdr, -+ const SenseData_t *Sensedata); - void dumpHex(const char* str, int len, int no_ascii); - int prout_do_scsi_ioctl( char * dev, int rq_servact, int rq_scope, - unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy); -@@ -113,7 +113,7 @@ retry : - - condlog(4, "%s: Duration=%u (ms)", dev, io_hdr.duration); - -- status = mpath_translate_response(dev, io_hdr, &Sensedata); -+ status = mpath_translate_response(dev, &io_hdr, &Sensedata); - condlog(3, "%s: status = %d", dev, status); - - if (status == MPATH_PR_SENSE_UNIT_ATTENTION && (retry > 0)) -@@ -359,7 +359,7 @@ retry : - condlog(3, "%s: duration = %u (ms)", dev, io_hdr.duration); - condlog(4, "%s: persistent reservation in: requested %d bytes but got %d bytes)", dev, mx_resp_len, got); - -- status = mpath_translate_response(dev, io_hdr, &Sensedata); -+ status = mpath_translate_response(dev, &io_hdr, &Sensedata); - - if (status == MPATH_PR_SENSE_UNIT_ATTENTION && (retry > 0)) - { -@@ -404,18 +404,18 @@ out: - return status; - } - --int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr, -- SenseData_t *Sensedata) -+int mpath_translate_response (const char *dev, struct sg_io_hdr *io_hdr, -+ const SenseData_t *Sensedata) - { - condlog(3, "%s: status driver:%02x host:%02x scsi:%02x", dev, -- io_hdr.driver_status, io_hdr.host_status ,io_hdr.status); -- io_hdr.status &= 0x7e; -- if ((0 == io_hdr.status) && -- (0 == io_hdr.host_status) && -- (0 == io_hdr.driver_status)) -+ io_hdr->driver_status, io_hdr->host_status ,io_hdr->status); -+ io_hdr->status &= 0x7e; -+ if ((0 == io_hdr->status) && -+ (0 == io_hdr->host_status) && -+ (0 == io_hdr->driver_status)) - return MPATH_PR_SUCCESS; - -- switch(io_hdr.status) { -+ switch(io_hdr->status) { - case SAM_STAT_GOOD: - break; - case SAM_STAT_CHECK_CONDITION: -@@ -455,13 +455,13 @@ int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr, - return MPATH_PR_OTHER; - } - -- switch(io_hdr.host_status) { -+ switch(io_hdr->host_status) { - case DID_OK : - break; - default : - return MPATH_PR_OTHER; - } -- switch(io_hdr.driver_status) -+ switch(io_hdr->driver_status) - { - case DRIVER_OK: - break; --- -1.8.3.1 - diff --git a/0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch b/0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch new file mode 100644 index 0000000..75654db --- /dev/null +++ b/0017-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch @@ -0,0 +1,139 @@ +From 4ac8e63deadf125004eacbc76859cfa7a46e1e16 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 + free may occur in verify_paths. + +call stack: + vecs=vecs@entry=0x557b01d62140, rpvec=rpvec@entry=0x0) at structs_vec.c:521 + at main.c:574 + uev=) at main.c:510 + uev_trigger=uev_trigger@entry=0x557affdfe3d0 , trigger_data=) + at uevent.c:178 +--- + libmultipath/discovery.c | 10 ++++++---- + libmultipath/discovery.h | 2 +- + multipathd/main.c | 23 ++++++++++++++++++++++- + 3 files changed, 29 insertions(+), 6 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index c49848e..2458bf5 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -112,7 +112,7 @@ transport (int h) + } + + int +-remove_local_path (vector pathvec, struct path *pp) ++remove_local_path (vector pathvec, struct path *pp, int isfree) + { + int i = -1; + +@@ -127,7 +127,9 @@ remove_local_path (vector pathvec, struct path *pp) + if ((i = find_slot(pathvec, (void *)pp)) != -1) { + vector_del_slot(pathvec, i); + } +- free_path(pp); ++ if(isfree){ ++ free_path(pp); ++ } + 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; + } + } +@@ -249,7 +251,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; + } + +diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h +index a438b44..ab73493 100644 +--- a/libmultipath/discovery.h ++++ b/libmultipath/discovery.h +@@ -56,7 +56,7 @@ int sysfs_get_asymmetric_access_state(struct path *pp, + char *buff, int buflen); + int get_uid(struct path * pp, int path_state, struct udev_device *udev, + int allow_fallback); +-int remove_local_path(vector pathvec, struct path *pp); ++int remove_local_path(vector pathvec, struct path *pp, int isfree); + + /* + * discovery bitmask +diff --git a/multipathd/main.c b/multipathd/main.c +index 41c4258..09ea102 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) + return flush_map(mpp, vecs, 0); + } + ++static ++void clear_ref_from_mpp(struct path * pp, struct vectors * vecs) ++{ ++ struct multipath * mpp = NULL; ++ int i = -1; ++ ++ mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); ++ if(!!mpp){ ++ condlog(2, "%s: clear path from mpp %s", pp->dev, mpp->alias); ++ if ((i = find_slot(mpp->paths, (void *)pp)) != -1){ ++ vector_del_slot(mpp->paths, i); ++ } ++ } ++} ++ + 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) + i = find_slot(vecs->pathvec, (void *)pp); + if (i != -1) + vector_del_slot(vecs->pathvec, i); ++ clear_ref_from_mpp(pp, vecs); + 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) + int ret; + + /* if pp is local path,remove it and return 0. */ +- if (!remove_local_path(vecs->pathvec, pp)) ++ if (!remove_local_path(vecs->pathvec, pp, 0)){ ++ clear_ref_from_mpp(pp, vecs); ++ free_path(pp); + return 0; ++ } + + /* + * need path UID to go any further +@@ -960,6 +979,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); ++ clear_ref_from_mpp(pp, vecs); + 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; +-- +1.8.3.1 + diff --git a/0018-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch b/0018-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch index 75654db..b945003 100644 --- a/0018-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch +++ b/0018-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch @@ -1,139 +1,87 @@ -From 4ac8e63deadf125004eacbc76859cfa7a46e1e16 Mon Sep 17 00:00:00 2001 +From db72d840682d15abb2e6694704a91200e513dbac 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 - free may occur in verify_paths. +Date: Fri, 22 Mar 2019 20:33:53 +0800 +Subject: [PATCH 5/5] libmultipath: fix memory leak in disassemble_map -call stack: - vecs=vecs@entry=0x557b01d62140, rpvec=rpvec@entry=0x0) at structs_vec.c:521 - at main.c:574 - uev=) at main.c:510 - uev_trigger=uev_trigger@entry=0x557affdfe3d0 , trigger_data=) - at uevent.c:178 --- - libmultipath/discovery.c | 10 ++++++---- - libmultipath/discovery.h | 2 +- - multipathd/main.c | 23 ++++++++++++++++++++++- - 3 files changed, 29 insertions(+), 6 deletions(-) + libmultipath/dmparser.c | 12 ++++++++++-- + libmultipath/structs_vec.c | 10 ++++++++++ + 2 files changed, 20 insertions(+), 2 deletions(-) -diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c -index c49848e..2458bf5 100644 ---- a/libmultipath/discovery.c -+++ b/libmultipath/discovery.c -@@ -112,7 +112,7 @@ transport (int h) - } +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; - int --remove_local_path (vector pathvec, struct path *pp) -+remove_local_path (vector pathvec, struct path *pp, int isfree) - { - int i = -1; + p = params; -@@ -127,7 +127,9 @@ remove_local_path (vector pathvec, struct path *pp) - if ((i = find_slot(pathvec, (void *)pp)) != -1) { - vector_del_slot(pathvec, i); - } -- free_path(pp); -+ if(isfree){ -+ free_path(pp); -+ } - return 0; - } +@@ -291,6 +292,7 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, + char devname[FILE_NAME_SIZE]; -@@ -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; - } - } -@@ -249,7 +251,7 @@ path_discover (vector pathvec, struct config * conf, - if (err) - return err; + pp = NULL; ++ pp_unfound = 0; + p += get_word(p, &word); -- remove_local_path(pathvec, pp); -+ remove_local_path(pathvec, pp, 1); - return err; - } + if (!word) +@@ -310,6 +312,7 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp, + } -diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h -index a438b44..ab73493 100644 ---- a/libmultipath/discovery.h -+++ b/libmultipath/discovery.h -@@ -56,7 +56,7 @@ int sysfs_get_asymmetric_access_state(struct path *pp, - char *buff, int buflen); - int get_uid(struct path * pp, int path_state, struct udev_device *udev, - int allow_fallback); --int remove_local_path(vector pathvec, struct path *pp); -+int remove_local_path(vector pathvec, struct path *pp, int isfree); + if (!pp) { ++ pp_unfound = 1; + pp = alloc_path(); - /* - * discovery bitmask -diff --git a/multipathd/main.c b/multipathd/main.c -index 41c4258..09ea102 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) - return flush_map(mpp, vecs, 0); - } + 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; ++ } -+static -+void clear_ref_from_mpp(struct path * pp, struct vectors * vecs) -+{ -+ struct multipath * mpp = NULL; -+ int i = -1; + /* + * 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; + -+ mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); -+ if(!!mpp){ -+ condlog(2, "%s: clear path from mpp %s", pp->dev, mpp->alias); -+ if ((i = find_slot(mpp->paths, (void *)pp)) != -1){ -+ vector_del_slot(mpp->paths, i); ++ 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); ++ } + } + } -+} -+ - 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) - i = find_slot(vecs->pathvec, (void *)pp); - if (i != -1) - vector_del_slot(vecs->pathvec, i); -+ clear_ref_from_mpp(pp, vecs); - 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) - int ret; - - /* if pp is local path,remove it and return 0. */ -- if (!remove_local_path(vecs->pathvec, pp)) -+ if (!remove_local_path(vecs->pathvec, pp, 0)){ -+ clear_ref_from_mpp(pp, vecs); -+ free_path(pp); - return 0; -+ } - - /* - * need path UID to go any further -@@ -960,6 +979,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); -+ clear_ref_from_mpp(pp, vecs); - 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; + int -- -1.8.3.1 +2.19.1 diff --git a/0019-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch b/0019-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch deleted file mode 100644 index b945003..0000000 --- a/0019-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/0020-fix-find-multipath-failure.patch b/0019-fix-find-multipath-failure.patch similarity index 100% rename from 0020-fix-find-multipath-failure.patch rename to 0019-fix-find-multipath-failure.patch diff --git a/0021-change-kpartx-file-and-default-bindir.patch b/0020-change-kpartx-file-and-default-bindir.patch similarity index 100% rename from 0021-change-kpartx-file-and-default-bindir.patch rename to 0020-change-kpartx-file-and-default-bindir.patch diff --git a/0022-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch b/0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch similarity index 100% rename from 0022-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch rename to 0021-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch diff --git a/0023-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch b/0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch similarity index 100% rename from 0023-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch rename to 0022-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch diff --git a/0024-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch b/0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch similarity index 100% rename from 0024-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch rename to 0023-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch diff --git a/0025-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch b/0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch similarity index 100% rename from 0025-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch rename to 0024-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch diff --git a/0026-fix-boolean-value-with-json-c-0.14.patch b/0025-fix-boolean-value-with-json-c-0.14.patch similarity index 100% rename from 0026-fix-boolean-value-with-json-c-0.14.patch rename to 0025-fix-boolean-value-with-json-c-0.14.patch diff --git a/multipath-tools.spec b/multipath-tools.spec index 88047df..3885b26 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -23,17 +23,16 @@ 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-some-memory-leaks-issues-in-libmpathpersist.patch -Patch17: 0017-bugfix-change-log-level-to-info-if-alua-is-not-support-by-s.patch -Patch18: 0018-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch -Patch19: 0019-bugfix-libmultipath-fix-memory-leak-in-disassemble_map.patch -Patch20: 0020-fix-find-multipath-failure.patch -Patch21: 0021-change-kpartx-file-and-default-bindir.patch -Patch22: 0022-master-libmultipath-fix-use-after-free-when-iscsi-lo.patch -Patch23: 0023-libmultipath-warn-if-freeing-path-that-holds-mpp-hwe.patch -Patch24: 0024-libmultipath-warn-about-NULL-value-of-mpp-hwe.patch -Patch25: 0025-libmultipath-fix-mpp-hwe-handling-in-sync_paths.patch -Patch26: 0026-fix-boolean-value-with-json-c-0.14.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 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 @@ -173,6 +172,12 @@ fi %changelog +* Fri Oct 16 2020 lixiaokeng - 0.8.4-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:remove patch that has been fix in 0.8.4 + * Fri Sep 25 2020 lixiaokeng - 0.8.4-3 - Type:bugfix - ID:NA -- Gitee