[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Don't cause watch fire deadlock by unconditionally rewriting the sysrq node.



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.