[Openais] [PATCH 7/7] Zero out unused totemsrp my_proc_list entries

angus salkeld angus.salkeld at alliedtelesis.co.nz
Tue Aug 19 18:08:15 PDT 2008


Committed as revision 1659.

-Angus

On Tue, 2008-08-19 at 16:23 -0700, Steven Dake wrote:
> looks good for commit.
> 
> Regards
> -steve
> On Wed, 2008-08-20 at 06:55 +1200, angus salkeld wrote:
> > When making my_proc_list smaller, ensure that the
> > now non-used entries are zero-ed out. There are some suspect
> > assert's that assume that there is always 2 entries in the list.
> > These fail when my_proc_list is reduced to 1 entry (and the
> > valid [0] entry is the same as the 'unused' [1] entry).
> > 
> > Author: Mark Wutzke <mark.wutzke at alliedtelesis.co.nz>
> > ---
> >  exec/totemsrp.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > diff --git a/exec/totemsrp.c b/exec/totemsrp.c
> > index 0b1f91b..1ba298e 100644
> > --- a/exec/totemsrp.c
> > +++ b/exec/totemsrp.c
> > @@ -1665,6 +1665,15 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance)
> >  	instance->my_last_aru = SEQNO_START_MSG;
> >  	sq_items_release (&instance->regular_sort_queue, SEQNO_START_MSG - 1);
> >  
> > +	/* When making my_proc_list smaller, ensure that the
> > +	 * now non-used entries are zero-ed out. There are some suspect
> > +	 * assert's that assume that there is always 2 entries in the list.
> > +	 * These fail when my_proc_list is reduced to 1 entry (and the
> > +	 * valid [0] entry is the same as the 'unused' [1] entry).
> > +	 */
> > +	memset(instance->my_proc_list, 0,
> > +		   sizeof (struct srp_addr) * instance->my_proc_list_entries);
> > +
> >  	instance->my_proc_list_entries = instance->my_new_memb_entries;
> >  	memcpy (instance->my_proc_list, instance->my_new_memb_list,
> >  		sizeof (struct srp_addr) * instance->my_memb_entries);
> 
-- 
*********************************************************************
Angus Salkeld
Specialist Software Engineer

27 Nazareth Ave
PO Box 8011
Christchurch 8035
Allied Telesis Labs Ltd.
New Zealand
Email:  angus.salkeld at alliedtelesyn.co.nz    
        http://www.alliedtelesyn.co.nz  
DDI: +64 3 339 9667  Fax:+64 3 339 3001         
*********************************************************************




More information about the Openais mailing list