[PATCH 2/2] Check for the correct message size in totempg_groups_joined_reserve()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <asalkeld@xxxxxxxxxx>
---
 exec/totempg.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/exec/totempg.c b/exec/totempg.c
index 3ece489..0af56f3 100644
--- a/exec/totempg.c
+++ b/exec/totempg.c
@@ -1246,13 +1246,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:
 	if (totempg_threaded_mode == 1) {
 		pthread_mutex_unlock (&mcast_msg_mutex);
-- 
1.7.7.3

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux