Procházet zdrojové kódy

Merge trunk revision 2757:
r2757 | asalkeld | 2010-04-12 12:51:38 -0700 (Mon, 12 Apr 2010) | 15 lines

When sync is aborted clear the "my_ring_id" variable.

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/branches/flatiron@2781 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake před 16 roky
rodič
revize
e93808f461
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      exec/syncv2.c

+ 5 - 0
exec/syncv2.c

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