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

[Xen-changelog] [xen-unstable] xenconsoled: Fix rate-limit calculation overflow leading to console freezes.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245752738 -3600
# Node ID 20c0df018786321b98a25f76eaa3e3183a1f162c
# Parent  b55070edb1854060914f4f313d62eb303501887c
xenconsoled: Fix rate-limit calculation overflow leading to console freezes.

From: Eric Tessler <eric@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/console/daemon/io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r b55070edb185 -r 20c0df018786 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Tue Jun 23 11:23:27 2009 +0100
+++ b/tools/console/daemon/io.c Tue Jun 23 11:25:38 2009 +0100
@@ -688,7 +688,7 @@ static struct domain *create_domain(int 
        dom->buffer.capacity = 0;
        dom->buffer.max_capacity = 0;
        dom->event_count = 0;
-       dom->next_period = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) + 
RATE_LIMIT_PERIOD;
+       dom->next_period = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 
1000000) + RATE_LIMIT_PERIOD;
        dom->next = NULL;
 
        dom->ring_ref = -1;
@@ -1009,7 +1009,7 @@ void handle_io(void)
 
                if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
                        return;
-               now = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
+               now = ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
 
                /* Re-calculate any event counter allowances & unblock
                   domains with new allowance */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.