Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
openais
> revision-1408.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File revision-1408.patch of Package openais
Index: exec/totemsrp.c =================================================================== --- exec/totemsrp.c (revision 1407) +++ exec/totemsrp.c (revision 1408) @@ -549,7 +549,8 @@ int fcc_mcasts_allowed); static void messages_free (struct totemsrp_instance *instance, unsigned int token_aru); -static void memb_ring_id_store (struct totemsrp_instance *instance); +static void memb_ring_id_set_and_store (struct totemsrp_instance *instance, + struct memb_ring_id *ring_id); static void memb_state_commit_token_update (struct totemsrp_instance *instance, struct memb_commit_token *commit_token); static void memb_state_commit_token_target_set (struct totemsrp_instance *instance, struct memb_commit_token *commit_token); static int memb_state_commit_token_send (struct totemsrp_instance *instance, struct memb_commit_token *memb_commit_token); @@ -1707,10 +1708,10 @@ memb_state_commit_token_target_set (instance, commit_token); + memb_ring_id_set_and_store (instance, &commit_token->ring_id); + memb_state_commit_token_send (instance, commit_token); - memcpy (&instance->my_ring_id, &commit_token->ring_id, - sizeof (struct memb_ring_id)); instance->token_ring_id_seq = instance->my_ring_id.seq; poll_timer_delete (instance->totemsrp_poll_handle, instance->memb_timer_state_gather_join_timeout); @@ -1920,7 +1921,6 @@ reset_token_timeout (instance); // REVIEWED reset_token_retransmit_timeout (instance); // REVIEWED - memb_ring_id_store (instance); instance->memb_state = MEMB_STATE_RECOVERY; return; @@ -2829,6 +2829,7 @@ } res = write (fd, &memb_ring_id->seq, sizeof (unsigned long long)); assert (res == sizeof (unsigned long long)); + fsync (fd); close (fd); } else { log_printf (instance->totemsrp_log_level_warning, @@ -2840,13 +2841,16 @@ instance->token_ring_id_seq = memb_ring_id->seq; } -static void memb_ring_id_store ( - struct totemsrp_instance *instance) +static void memb_ring_id_set_and_store ( + struct totemsrp_instance *instance, + struct memb_ring_id *ring_id) { char filename[256]; int fd; int res; + memcpy (&instance->my_ring_id, ring_id, sizeof (struct memb_ring_id)); + sprintf (filename, "%s/ringid_%s", rundir, totemip_print (&instance->my_id.addr[0])); @@ -2866,6 +2870,7 @@ //assert (fd > 0); res = write (fd, &instance->my_ring_id.seq, sizeof (unsigned long long)); assert (res == sizeof (unsigned long long)); + fsync (fd); close (fd); }