]> git.proxmox.com Git - mirror_corosync.git/commitdiff
When sync is aborted clear the "my_ring_id" variable.
authorAngus Salkeld <asalkeld@redhat.com>
Mon, 12 Apr 2010 19:51:38 +0000 (19:51 +0000)
committerAngus Salkeld <asalkeld@redhat.com>
Mon, 12 Apr 2010 19:51:38 +0000 (19:51 +0000)
This patch fixes crashes found by repeated pacemaker CTS SimluStart
tests. When you bring up the nodes together it can cause a lot of
configuration changes and sync gets started and aborted
lots of times.

When abort is called the ring_id is not changed which means that any
sync packet that arrive from that point on will be accepted as valid.
I have seen old barrier messages causing the processing index to increment
later causing an array out of bounds.

This patch memsets the ring_id to 0, thus causing the ring_id in the packet and
my_ring_id not to match.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2757 fd59a12c-fef9-0310-b244-a6a79926bd2f

exec/syncv2.c

index 40086ec032968a69e66ca1d4c5c2d80d33b59040..1b6c61716a1580cc0e884970b3f4b8e80dedbb9f 100644 (file)
@@ -599,6 +599,11 @@ void sync_v2_abort (void)
                schedwrk_destroy (my_schedwrk_handle);
                my_service_list[my_processing_idx].sync_abort ();
        }
+
+       /* this will cause any "old" barrier messages from causing
+        * problems.
+        */
+       memset (&my_ring_id, 0, sizeof (struct memb_ring_id));
 }
 
 void sync_v2_memb_list_determine (const struct memb_ring_id *ring_id)