[PATCH 42/42] multipathd: lock vectors during initial configuration

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

 



During initial configuration the CLI thread is already running,
so we need to lock the vectors here to not race with the
'reconfigure' CLI command.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 multipathd/main.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 395307e..8917499 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1389,7 +1389,6 @@ reconfigure (struct vectors * vecs)
 	struct config * old = conf;
 	int retval = 1;
 
-	lock(vecs->lock);
 	/*
 	 * free old map and path vectors ... they use old conf state
 	 */
@@ -1410,7 +1409,6 @@ reconfigure (struct vectors * vecs)
 		retval = 0;
 	}
 
-	unlock(vecs->lock);
 	return retval;
 }
 
@@ -1641,9 +1639,9 @@ child (void * param)
 	/*
 	 * fetch and configure both paths and multipaths
 	 */
-	lock(vecs->lock);
 	running_state = DAEMON_CONFIGURE;
 
+	lock(vecs->lock);
 	if (configure(vecs, 1)) {
 		unlock(vecs->lock);
 		condlog(0, "failure during configuration");
-- 
1.7.4.2

--
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