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 blkback request notification holdoff. req_cons must

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix blkback request notification holdoff. req_cons must be
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Dec 2005 12:04:34 +0000
Delivery-date: Sat, 03 Dec 2005 12:07:52 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix blkback request notification holdoff. req_cons must be, Xen patchbot -unstable <=