瀏覽代碼

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 年之前
父節點
當前提交
21199e23cc
共有 1 個文件被更改,包括 8 次插入1 次删除
  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);
 }