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

xen-devel

[Top] [All Lists]

[Xen-devel] [patch] fix xenbus race

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [patch] fix xenbus race
From: Gerd Knorr <kraxel@xxxxxxx>
Date: 2005年10月31日 15:16:05 +0100
Delivery-date: 2005年10月31日 14:13:15 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050715)
 Hi,
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. That one fixes the network issues I'm seeing. Due to the race the "online" hotplug event for the vif backend was lost sometimes.
please apply,
 Gerd
diff -r 43676a509982 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Sun Oct 30 
18:23:36 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Mon Oct 31 
15:08: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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: [Xen-devel] xenbus question , Gerd Knorr
Next by Date: Re: [Xen-devel] [PATCH] Changes to allow dynamic enabling/disabling of trace buffers , Rob Gardner
Previous by Thread: [Xen-devel] xenbus question , Gerd Knorr
Next by Thread: Re: [Xen-devel] [patch] fix xenbus race , Keir Fraser
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /