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] Don't cause watch fire deadlock by unconditionally rewri

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Don't cause watch fire deadlock by unconditionally rewriting the sysrq node.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Sep 2005 21:30:12 +0000
Delivery-date: Tue, 13 Sep 2005 21:28:43 +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 36c4d3bb29c83cc847a4880e5755dffce54dbc78
# Parent  3eea03342466e50e983ecb49436650b89c8509e5
Don't cause watch fire deadlock by unconditionally rewriting the sysrq node.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 3eea03342466 -r 36c4d3bb29c8 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Tue Sep 13 21:00:13 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Tue Sep 13 21:24:03 2005
@@ -355,16 +355,26 @@
 static void sysrq_handler(struct xenbus_watch *watch, const char *node)
 {
     char sysrq_key = '\0';
-    
+    int err;
+
+ again:
+    err = xenbus_transaction_start("control");
+    if (err)
+       return;
     if (!xenbus_scanf("control", "sysrq", "%c", &sysrq_key)) {
         printk(KERN_ERR "Unable to read sysrq code in control/sysrq\n");
-        return;
-    }
-
-    xenbus_printf("control", "sysrq", "%c", '\0');
+       xenbus_transaction_end(1);
+       return;
+    }
+
+    if (sysrq_key != '\0')
+       xenbus_printf("control", "sysrq", "%c", '\0');
+
+    err = xenbus_transaction_end(0);
+    if (err == -ETIMEDOUT)
+       goto again;
 
     if (sysrq_key != '\0') {
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         handle_sysrq(sysrq_key, NULL, NULL);
 #else

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Don't cause watch fire deadlock by unconditionally rewriting the sysrq node., Xen patchbot -unstable <=