From 7b02f176df03060db445e9f7ec1ee894af906e43 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Wed, 14 Dec 2011 12:06:41 +1100 Subject: [PATCH] Check for the correct message size in totempg_groups_joined_reserve() Currently: - send_reserve() adds to the reserve - msg_count_send_ok() tests ((avail - totempg_reserved) > msg_count) So essentially we are checking to see if 2 * msg_count can fit in the q. So instead I am using byte_count_send_ok (size) to see if the message will fit then calling send_reserve() Signed-off-by: Angus Salkeld Reviewed-by: Steven Dake --- exec/totempg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exec/totempg.c b/exec/totempg.c index 3a43541f..3f07c950 100644 --- a/exec/totempg.c +++ b/exec/totempg.c @@ -1251,13 +1251,12 @@ int totempg_groups_joined_reserve ( goto error_exit; } - reserved = send_reserve (size); - if (msg_count_send_ok (reserved) == 0) { - send_release (reserved); + if (byte_count_send_ok (size)) { + reserved = send_reserve (size); + } else { reserved = 0; } - error_exit: check_q_level(instance);