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] [xen-unstable] [LINUX] Fix blkfront driver to check conn

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [LINUX] Fix blkfront driver to check connection status to backend in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jun 2006 15:25:23 +0000
Delivery-date: Wed, 14 Jun 2006 08:27:22 -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 kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 91d2f2258c563100d5294fe12fd9fbe56870b213
# Parent  1650e07c9e5261dc823e156dc0a9350e98f870bc
[LINUX] Fix blkfront driver to check connection status to backend in
all critical circumstances.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff -r 1650e07c9e52 -r 91d2f2258c56 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Jun 13 
14:36:04 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Jun 13 
15:13:29 2006 +0100
@@ -407,7 +407,8 @@ static void blkif_restart_queue(void *ar
 {
        struct blkfront_info *info = (struct blkfront_info *)arg;
        spin_lock_irq(&blkif_io_lock);
-       kick_pending_request_queues(info);
+       if (info->connected == BLKIF_STATE_CONNECTED)
+               kick_pending_request_queues(info);
        spin_unlock_irq(&blkif_io_lock);
 }
 
@@ -595,7 +596,8 @@ void do_blkif_request(request_queue_t *r
                        continue;
                }
 
-               if (RING_FULL(&info->ring))
+               if (unlikely(info->connected != BLKIF_STATE_CONNECTED) ||
+                   RING_FULL(&info->ring))
                        goto wait;
 
                DPRINTK("do_blk_req %p: cmd %p, sec %lx, "
@@ -768,17 +770,17 @@ static void blkif_recover(struct blkfron
 
        (void)xenbus_switch_state(info->xbdev, XenbusStateConnected);
 
+       spin_lock_irq(&blkif_io_lock);
+
        /* Now safe for us to use the shared ring */
-       spin_lock_irq(&blkif_io_lock);
        info->connected = BLKIF_STATE_CONNECTED;
-       spin_unlock_irq(&blkif_io_lock);
 
        /* Send off requeued requests */
        flush_requests(info);
 
        /* Kick any other new requests queued since we resumed */
-       spin_lock_irq(&blkif_io_lock);
        kick_pending_request_queues(info);
+
        spin_unlock_irq(&blkif_io_lock);
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [LINUX] Fix blkfront driver to check connection status to backend in, Xen patchbot-unstable <=