[Openais] [PATCH 2/7] Fix an assert caused by faulty sort-queue management.

angus salkeld angus.salkeld at alliedtelesis.co.nz
Tue Aug 19 17:55:55 PDT 2008


committed (just sq.h)

-Angus

On Tue, 2008-08-19 at 16:20 -0700, Steven Dake wrote:
> The second change (sq_items_release) looks good for commit.  Can you
> make that a seperate patch and merge it?
> 
> The first change, why would an item already be in use in the sort queue?
> I am not happy to see a patch like this as it indicates some failure
> elsewhere in the code.
> 
> Regards
> -steve
> 
> 
> On Wed, 2008-08-20 at 06:54 +1200, angus salkeld wrote:
> > totemsrp.c
> >   - orf_token_mcast(): Check if the SL item we are about to add is already
> >     in use. If it is, then don't add it to the list. This will stop a
> >     possible assert in the SL routines.
> > sq.h
> >   - sq_items_release(): When clearing the items_inuse array, ensure that
> >     all of the memory is cleared. items_inuse is a uint array, not a
> >     byte array.
> > 
> > Author: Mark Wutzke <markw at alliedtelesis.co.nz>
> > ---
> >  exec/totemsrp.c       |    3 +++
> >  include/corosync/sq.h |    2 +-
> >  2 files changed, 4 insertions(+), 1 deletions(-)
> > 
> > diff --git a/exec/totemsrp.c b/exec/totemsrp.c
> > index 9c01a3c..fa434f8 100644
> > --- a/exec/totemsrp.c
> > +++ b/exec/totemsrp.c
> > @@ -2262,6 +2262,9 @@ static int orf_token_mcast (
> >  		if (queue_is_empty (mcast_queue)) {
> >  			break;
> >  		}
> > +		if (sq_item_inuse (sort_queue, token->seq + 1) != 0) {
> > +			break;
> > +		}
> >  		message_item = (struct message_item *)queue_item_get (mcast_queue);
> >  		/* preincrement required by algo */
> >  		if (instance->old_ring_state_saved &&
> > diff --git a/include/corosync/sq.h b/include/corosync/sq.h
> > index cd64975..ac65f09 100644
> > --- a/include/corosync/sq.h
> > +++ b/include/corosync/sq.h
> > @@ -277,7 +277,7 @@ static inline void sq_items_release (struct sq *sq, unsigned int seqid)
> >  	if ((oldhead + seqid - sq->head_seqid + 1) > sq->size) {
> >  //		printf ("releasing %d for %d\n", oldhead, sq->size - oldhead);
> >  //		printf ("releasing %d for %d\n", 0, sq->head);
> > -		memset (&sq->items_inuse[oldhead], 0, sq->size - oldhead);
> > +		memset (&sq->items_inuse[oldhead], 0, (sq->size - oldhead) * sizeof (unsigned int));
> >  		memset (sq->items_inuse, 0, sq->head * sizeof (unsigned int));
> >  	} else {
> >  //		printf ("releasing %d for %d\n", oldhead, seqid - sq->head_seqid + 1);
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais
-- 
*********************************************************************
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