[dm-devel] [PATCH 6/7] multipathd: remove INIT_PARTIAL paths that aren't in a multipath device
Benjamin Marzinski
bmarzins at redhat.com
Wed Oct 20 19:15:21 UTC 2021
The only reason multipath is monitoring an INIT_PARTIAL path is because
it was discovered in a multipath device table. If it stops being part
of a multipath device before it gets fully initialized, drop it.
Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
libmultipath/structs_vec.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 1de9175e..3f60f3d5 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -307,9 +307,12 @@ void orphan_paths(vector pathvec, struct multipath *mpp, const char *reason)
vector_foreach_slot (pathvec, pp, i) {
if (pp->mpp == mpp) {
- if (pp->initialized == INIT_REMOVED) {
- condlog(3, "%s: freeing path in removed state",
- pp->dev);
+ if (pp->initialized == INIT_REMOVED ||
+ pp->initialized == INIT_PARTIAL) {
+ condlog(3, "%s: freeing path in %s state",
+ pp->dev,
+ pp->initialized == INIT_REMOVED ?
+ "removed" : "partial");
vector_del_slot(pathvec, i--);
free_path(pp);
} else
@@ -468,11 +471,14 @@ static void check_removed_paths(const struct multipath *mpp, vector pathvec)
int i;
vector_foreach_slot(pathvec, pp, i) {
- if (pp->initialized != INIT_REMOVED || pp->mpp != mpp)
- continue;
- if (!find_devt_in_pathgroups(mpp, pp->dev_t)) {
- condlog(2, "%s: %s: freeing path in removed state",
- __func__, pp->dev);
+ if (pp->mpp == mpp &&
+ (pp->initialized == INIT_REMOVED ||
+ pp->initialized == INIT_PARTIAL) &&
+ !find_devt_in_pathgroups(mpp, pp->dev_t)) {
+ condlog(2, "%s: %s: freeing path in %s state",
+ __func__, pp->dev,
+ pp->initialized == INIT_REMOVED ?
+ "removed" : "partial");
vector_del_slot(pathvec, i--);
free_path(pp);
}
--
2.17.2
More information about the dm-devel
mailing list