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 another blkback kernel thread I introduced. :-( The

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix another blkback kernel thread I introduced. :-( The kernel thread
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Apr 2006 19:32:16 +0000
Delivery-date: Thu, 06 Apr 2006 12:33:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 32b22f5286beba94318e60704a8058ac3833d502
# Parent  251b7d5164bd043946f69c711757209ae378720c
Fix another blkback kernel thread I introduced. :-( The kernel thread
is created before we are fully connected to the front end, so before
entering the main loop we must make sure that the shared ring is
mapped, otherwise we can fault.

This patch is an essential companion to the other two blkback
patches I committed earlier today. Hopefully this ends the saga.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 251b7d5164bd -r 32b22f5286be 
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Thu Apr  6 
16:51:14 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Thu Apr  6 
17:34:32 2006
@@ -221,6 +221,14 @@
 
        if (debug_lvl)
                printk(KERN_DEBUG "%s: started\n", current->comm);
+
+       /*
+        * This thread may start before we are connected to the frontend
+        * driver. In that case we must wait to be fully connected.
+        */
+       wait_event_interruptible(
+               blkif->wq,
+               blkif_connected(blkif) || kthread_should_stop());
 
        while (!kthread_should_stop()) {
                wait_event_interruptible(
diff -r 251b7d5164bd -r 32b22f5286be 
linux-2.6-xen-sparse/drivers/xen/blkback/common.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Thu Apr  6 16:51:14 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h Thu Apr  6 17:34:32 2006
@@ -135,6 +135,8 @@
 
 void update_blkif_status(blkif_t *blkif); 
 
+int blkif_connected(blkif_t *blkif);
+
 #endif /* __BLKIF__BACKEND__COMMON_H__ */
 
 /*
diff -r 251b7d5164bd -r 32b22f5286be 
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Thu Apr  6 16:51:14 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Thu Apr  6 17:34:32 2006
@@ -47,6 +47,10 @@
 static void backend_changed(struct xenbus_watch *, const char **,
                            unsigned int);
 
+int blkif_connected(blkif_t *blkif)
+{
+       return (blkif->be->dev->state == XenbusStateConnected);
+}
 
 void update_blkif_status(blkif_t *blkif)
 { 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix another blkback kernel thread I introduced. :-( The kernel thread, Xen patchbot -3 . 0-testing <=