Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2013 19:58:54 +0200
From:      =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
To:        "freebsd-xen@freebsd.org" <freebsd-xen@freebsd.org>
Cc:        "Justin T. Gibbs" <gibbs@freebsd.org>
Subject:   blkback making assumptions about the id of the requests
Message-ID:  <5224D1DE.8080906@citrix.com>

next in thread | raw e-mail | index | archive | help
--------------040403030603090609030105
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

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.

--------------040403030603090609030105
Content-Type: text/plain; charset="UTF-8"; x-mac-type=0; x-mac-creator=0;
	name="0001-xen-blkback-don-t-make-assumptions-about-request-ids.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename*0="0001-xen-blkback-don-t-make-assumptions-about-request-ids.pa";
	filename*1="tch"

>From 01c3edc4446b113ec85537bb75c56c6072c4ee49 Mon Sep 17 00:00:00 2001
From: Roger Pau Monne <roger.pau@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)


--------------040403030603090609030105--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5224D1DE.8080906>