[Openais] [PATCH 2/7] Fix an assert caused by faulty sort-queue management.
Steven Dake
sdake at redhat.com
Tue Aug 19 16:20:11 PDT 2008
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);
More information about the Openais
mailing list