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] Watch events may get lost, the xenstored response races

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Watch events may get lost, the xenstored response races against the new
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 31 Oct 2005 17:10:06 +0000
Delivery-date: Mon, 31 Oct 2005 17:07:41 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ea6d9f29dff5d429c0a7cb6c381628e6f2bb38e1
# Parent  8cc7ce549d00bef90a568ed64a0309cec3d399e9
Watch events may get lost, the xenstored response races against the new 
watch being added to the watch list in register_xenbus_watch().  Fixed 
by adding the watch to the list unconditionally, and remove it in the 
error case.

diff -r 8cc7ce549d00 -r ea6d9f29dff5 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Oct 31 
09:45:31 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Oct 31 
16:07:14 2005
@@ -682,14 +682,15 @@
 
        spin_lock(&watches_lock);
        BUG_ON(find_watch(token));
+       list_add(&watch->list, &watches);
        spin_unlock(&watches_lock);
 
        err = xs_watch(watch->node, token);
 
        /* Ignore errors due to multiple registration. */
-       if ((err == 0) || (err == -EEXIST)) {
+       if ((err != 0) && (err != -EEXIST)) {
                spin_lock(&watches_lock);
-               list_add(&watch->list, &watches);
+               list_del(&watch->list);
                spin_unlock(&watches_lock);
        }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Watch events may get lost, the xenstored response races against the new, Xen patchbot -unstable <=