Hello,

While playing with driver domains using FreeBSD I've found out that
blkback in FreeBSD makes assumptions about the id of a request instead
of actually using the id of the request on the shared ring. This seems
wrong to me, since a frontend might choose whatever ids it like for the
requests (like using 100-131 instead of 0-31). The patch attached fixes
it by copying the id from the request on the ring to blkback internal
request structure.

Roger.
>From 01c3edc4446b113ec85537bb75c56c6072c4ee49 Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger....@citrix.com>
Date: Mon, 2 Sep 2013 15:51:47 +0200
Subject: [PATCH] xen-blkback: don't make assumptions about request ids

Blkback makes assumptions about the id of the request it received
from the frontend, this patch fixes it by always honoring the
id passed from the frontend instead of assuming there's an implicit
order in the id of the requests.
---
 sys/dev/xen/blkback/blkback.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index 2a220c4..500b347 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -1239,6 +1239,7 @@ xbb_get_resources(struct xbb_softc *xbb, struct 
xbb_xen_reqlist **reqlist,
 
        nreq->reqlist = *reqlist;
        nreq->req_ring_idx = ring_idx;
+       nreq->id = ring_req->id;
 
        if (xbb->abi != BLKIF_PROTOCOL_NATIVE) {
                bcopy(ring_req, &nreq->ring_req_storage, sizeof(*ring_req));
-- 
1.7.7.5 (Apple Git-26)

_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to