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

[Xen-changelog] [xen-4.0-testing] tmem: two wrongs (or three lefts and a wrong) make a right



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1292409142 0
# Node ID 9c7b9e65bc37b15b4a227937eee5b2e4368e5ce4
# Parent  e7d9d8d46730f3ca0cd60efd2e55181e2bd4e863
tmem: two wrongs (or three lefts and a wrong) make a right

These two bugs apparently complement each other enough that
they escaped problems in my testing, but eventually gum
up the works and are obviously horribly wrong.

Found while developing tmem for native Linux.

Signed-off-by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
xen-unstable changeset:   22525:01f3b3509023
xen-unstable date:        Wed Dec 15 10:27:18 2010 +0000
---
 xen/common/tmem.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r e7d9d8d46730 -r 9c7b9e65bc37 xen/common/tmem.c
--- a/xen/common/tmem.c Wed Dec 15 10:31:59 2010 +0000
+++ b/xen/common/tmem.c Wed Dec 15 10:32:22 2010 +0000
@@ -863,17 +863,17 @@ int oid_compare(OID *left, OID *right)
         {
             if ( left->oid[0] == right->oid[0] )
                 return 0;
-            else if ( left->oid[0] < left->oid[0] )
+            else if ( left->oid[0] < right->oid[0] )
                 return -1;
             else
                 return 1;
         }
-        else if ( left->oid[1] < left->oid[1] )
+        else if ( left->oid[1] < right->oid[1] )
             return -1;
         else
             return 1;
     }
-    else if ( left->oid[2] < left->oid[2] )
+    else if ( left->oid[2] < right->oid[2] )
         return -1;
     else
         return 1;
@@ -970,7 +970,7 @@ static NOINLINE int obj_rb_insert(struct
     {
         this = container_of(*new, obj_t, rb_tree_node);
         parent = *new;
-        switch ( oid_compare(&obj->oid, &this->oid) )
+        switch ( oid_compare(&this->oid, &obj->oid) )
         {
             case 0:
                 return 0;

_______________________________________________
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®.