[LINUX] A better way to stop blkdev request handling in blkfront
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Jun 2006 14:33:10 +0000 (15:33 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Jun 2006 14:33:10 +0000 (15:33 +0100)
driver.
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c

index bb718289090706e2217bd69e521e1391814f6ebc..1a2156600d74e7ba5d8850f588095b212bb2df9f 100644 (file)
@@ -596,8 +596,7 @@ void do_blkif_request(request_queue_t *rq)
                        continue;
                }
 
-               if (unlikely(info->connected != BLKIF_STATE_CONNECTED) ||
-                   RING_FULL(&info->ring))
+               if (RING_FULL(&info->ring))
                        goto wait;
 
                DPRINTK("do_blk_req %p: cmd %p, sec %lx, "
@@ -697,6 +696,7 @@ static void blkif_free(struct blkfront_info *info, int suspend)
        spin_lock_irq(&blkif_io_lock);
        info->connected = suspend ?
                BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED;
+       blk_stop_queue(info->rq); /* no more blkif_request() */
        spin_unlock_irq(&blkif_io_lock);
 
        /* Free resources associated with old device channel. */