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] Inside xenbus_switch_state, don't write the new state if

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Inside xenbus_switch_state, don't write the new state if the node has already
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Nov 2005 21:00:07 +0000
Delivery-date: Wed, 23 Nov 2005 21:00:24 +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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID fc41a9c9bc3667667ce7b996acdff13898031fd3
# Parent  fb42478203b9453d5b7bb88d88753627c9e67be1
Inside xenbus_switch_state, don't write the new state if the node has already
disappeared.  This happens when the driver is being torn down, and we don't
want to resurrect the device directory in the store because of it.

Partially addresses bug #424.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r fb42478203b9 -r fc41a9c9bc36 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c   Wed Nov 23 
18:45:57 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c   Wed Nov 23 
18:47:54 2005
@@ -97,14 +97,17 @@
        /* We check whether the state is currently set to the given value, and
           if not, then the state is set.  We don't want to unconditionally
           write the given state, because we don't want to fire watches
-          unnecessarily.
+          unnecessarily.  Furthermore, if the node has gone, we don't write
+          to it, as the device will be tearing down, and we don't want to
+          resurrect that directory.
         */
 
        int current_state;
 
        int err = xenbus_scanf(xbt, dev->nodename, "state", "%d",
                               &current_state);
-       if (err == 1 && (XenbusState)current_state == state)
+       if ((err == 1 && (XenbusState)current_state == state) ||
+           err == -ENOENT)
                return 0;
 
        err = xenbus_printf(xbt, dev->nodename, "state", "%d", state);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Inside xenbus_switch_state, don't write the new state if the node has already, Xen patchbot -unstable <=