Răsfoiți Sursa

defect 828
assert in totemsrp_avail occurs with certain test cases. The code was rounding
down to zero when calculating the number of messages required. This patch adds
one in all cases so no roundoff occurs.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@807 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 ani în urmă
părinte
comite
21199e23cc
1 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 8 1
      exec/totempg.c

+ 8 - 1
exec/totempg.c

@@ -641,8 +641,15 @@ int totempg_send_ok (
 	int total;
 
 	avail = totemmrp_avail ();
+	
+	/*
+	 * msg size less then totempg_totem_config->net_mtu - 25 will take up
+	 * a full message, so add +1
+	 * totempg_totem_config->net_mtu - 25 is for the totempg_mcast header
+	 */
+
 
-	total = (msg_size / (totempg_totem_config->net_mtu - 25) /* for totempg_mcat header */);
+	total = (msg_size / (totempg_totem_config->net_mtu - 25)) + 1; 
 
 	return (avail >= total);
 }