WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tmem: two wrongs (or three lefts and a wr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tmem: two wrongs (or three lefts and a wrong) make a right
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Dec 2010 05:34:25 -0800
Delivery-date: Thu, 23 Dec 2010 05:41:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1292408838 0
# Node ID 01f3b350902385627d1fa9e8cd1c231953e7610c
# Parent  1f08b2932a52fabc0369edd85c7cc1975323fb67
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/common/tmem.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 1f08b2932a52 -r 01f3b3509023 xen/common/tmem.c
--- a/xen/common/tmem.c Wed Dec 15 10:21:05 2010 +0000
+++ b/xen/common/tmem.c Wed Dec 15 10:27:18 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tmem: two wrongs (or three lefts and a wrong) make a right, Xen patchbot-unstable <=