[PATCH] Ignore sync barrier msgs if sync doesn't started

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

 



On start of corosync, we can receive sync barrier message. If so,
our sync_ring_id is set to NULL, and memcpy of message ring_id will
segfault. Instead of that, sync barrier message is ignored if
sync_ring_id is NULL.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/sync.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/exec/sync.c b/exec/sync.c
index 58518ac..42cd11c 100644
--- a/exec/sync.c
+++ b/exec/sync.c
@@ -392,6 +392,12 @@ static void sync_deliver_fn (
 		sync_endian_convert (req_exec_sync_barrier_start);
 	}
 
+	if (sync_ring_id == NULL) {
+		log_printf (LOGSYS_LEVEL_DEBUG,
+		    "Initial sync was not yet proceed. Ignoring sync msg\n");
+		return ;
+	}
+
 	barrier_completed = 1;
 
 	memcpy (&deliver_ring_id, &req_exec_sync_barrier_start->ring_id,
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux