[PATCH 6/6] libmultipath: only add uninitialized paths in check_path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With find_multipaths enabled, there can be non-blacklisted paths that
are not supposed to be part of any multipath device. To make sure that
check_path doesn't keep checking them, this patch marks paths which are
fully initialized. Only uninitialized paths are checked, if they don't
belong to a multipath device.

Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
---
 libmultipath/discovery.c | 2 ++
 libmultipath/structs.h   | 1 +
 multipathd/main.c        | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index af2aa20..91eab74 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1250,6 +1250,7 @@ pathinfo (struct path *pp, vector hwtable, int mask)
 		}
 	}
 
+	pp->initialized = 1;
 	return 0;
 
 blank:
@@ -1258,6 +1259,7 @@ blank:
 	 */
 	memset(pp->wwid, 0, WWID_SIZE);
 	pp->chkrstate = pp->state = PATH_DOWN;
+	pp->initialized = 0;
 
 	return 0;
 }
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index 15e7e19..abd1c29 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -186,6 +186,7 @@ struct path {
 	struct checker checker;
 	struct multipath * mpp;
 	int fd;
+	int initialized;
 
 	/* configlet pointers */
 	struct hwentry * hwe;
diff --git a/multipathd/main.c b/multipathd/main.c
index e697897..5da31bb 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1124,6 +1124,9 @@ check_path (struct vectors * vecs, struct path * pp)
 	int chkr_new_path_up = 0;
 	int oldchkrstate = pp->chkrstate;
 
+	if (pp->initialized && !pp->mpp)
+		return 0;
+
 	if (pp->tick && --pp->tick)
 		return 0; /* don't check this path yet */
 
-- 
1.8.3.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux