diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-03 11:41:49 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-12-03 11:41:49 +0100 |
commit | ad7f8262e3bed2dd8894a84fa2251d872150dc75 (patch) | |
tree | 9bcb0be17a5a7e79b97587af4bdefe154c46988e | |
parent | 8e40022f8e08a9650e0bab31644866a2364496e6 (diff) | |
download | xen-ad7f8262e3bed2dd8894a84fa2251d872150dc75.tar.gz xen-ad7f8262e3bed2dd8894a84fa2251d872150dc75.tar.bz2 xen-ad7f8262e3bed2dd8894a84fa2251d872150dc75.zip |
Fix blkback request notification holdoff. req_cons must be
updated before make_response() is called. This fixes attaching
ramdisk-backed vbds to a blkfront.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c index 0e2c8105cc..f689dd0662 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c @@ -296,22 +296,23 @@ static int do_block_io_op(blkif_t *blkif, int max_to_do) { blkif_back_ring_t *blk_ring = &blkif->blk_ring; blkif_request_t *req; - RING_IDX i, rp; + RING_IDX rc, rp; int more_to_do = 0; + rc = blk_ring->req_cons; rp = blk_ring->sring->req_prod; rmb(); /* Ensure we see queued requests up to 'rp'. */ - for (i = blk_ring->req_cons; - (i != rp) && !RING_REQUEST_CONS_OVERFLOW(blk_ring, i); - i++) { + while ((rc != rp) && !RING_REQUEST_CONS_OVERFLOW(blk_ring, rc)) { if ((max_to_do-- == 0) || (NR_PENDING_REQS == MAX_PENDING_REQS)) { more_to_do = 1; break; } - - req = RING_GET_REQUEST(blk_ring, i); + + req = RING_GET_REQUEST(blk_ring, rc); + blk_ring->req_cons = ++rc; /* before make_response() */ + switch (req->operation) { case BLKIF_OP_READ: case BLKIF_OP_WRITE: @@ -327,7 +328,6 @@ static int do_block_io_op(blkif_t *blkif, int max_to_do) } } - blk_ring->req_cons = i; return more_to_do; } |