All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] fix xenbus race
@ 2005-10-31 14:16 Gerd Knorr
  2005-10-31 15:25 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Knorr @ 2005-10-31 14:16 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

   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

[-- Attachment #2: xenbus-race.diff --]
[-- Type: text/x-patch, Size: 690 bytes --]

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);
 	}
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-31 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31 14:16 [patch] fix xenbus race Gerd Knorr
2005-10-31 15:25 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.