[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix blkback request notification holdoff. req_cons must be
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 8754277cec01d26b7174a3ef8644ef557f42ed26 # Parent 4c588e255c8595f0502a56555a68379f8fcb034d 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@xxxxxxxxxxxxx> diff -r 4c588e255c85 -r 8754277cec01 linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Sat Dec 3 10:00:03 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Sat Dec 3 10:41:49 2005 @@ -296,22 +296,23 @@ { 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 @@ } } - blk_ring->req_cons = i; return more_to_do; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |