Просмотр исходного кода

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 <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Angus Salkeld 14 лет назад
Родитель
Сommit
7b02f176df
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      exec/totempg.c

+ 3 - 4
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);