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] Fix case where watch callback unregisters itself: do not

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix case where watch callback unregisters itself: do not try to ack it
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jul 2005 20:26:20 -0400
Delivery-date: Wed, 27 Jul 2005 00:28:10 +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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 5f04469075016429efbba7fef18adcc6682885a4
# Parent  26e4e952c385894cec4a028eeceb102e348def27
Fix case where watch callback unregisters itself: do not try to ack it
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 26e4e952c385 -r 5f0446907501 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Tue Jul 26 
17:25:57 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Tue Jul 26 
17:27:26 2005
@@ -485,6 +485,8 @@
        return err;
 }
 
+static struct xenbus_watch *watch_callback;
+
 void unregister_xenbus_watch(struct xenbus_watch *watch)
 {
        char token[sizeof(watch) * 2 + 1];
@@ -495,6 +497,10 @@
 
        err = xs_unwatch(watch->node, token);
        list_del(&watch->list);
+
+       /* Make sure watch thread knows we unwatched, so don't ack. */
+       if (watch_callback == watch)
+               watch_callback = NULL;
 
        if (err)
                printk(KERN_WARNING "XENBUS Failed to release watch %s: %i\n",
@@ -523,13 +529,16 @@
 
                        w = find_watch(token);
                        BUG_ON(!w);
+                       watch_callback = w;
                        w->callback(w, node);
-                       /* FIXME: Only ack if it wasn't deleted. */
-                       err = xs_acknowledge_watch(token);
-                       if (err)
-                               printk(KERN_WARNING
-                                      "XENBUS acknowledge %s failed %i\n",
-                                      node, err);
+
+                       if (watch_callback) {
+                               err = xs_acknowledge_watch(token);
+                               if (err)
+                                       printk(KERN_WARNING
+                                              "XENBUS ack %s fail %i\n",
+                                              node, err);
+                       }
                        kfree(node);
                } else
                        printk(KERN_WARNING "XENBUS xs_read_watch: %li\n",

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix case where watch callback unregisters itself: do not try to ack it, Xen patchbot -unstable <=