summaryrefslogtreecommitdiffstats
path: root/sys/dev/xen
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2010-12-06 20:40:15 +0000
committercperciva <cperciva@FreeBSD.org>2010-12-06 20:40:15 +0000
commita78f502d16b3bff370840e3acc8a0e659f17bb24 (patch)
tree1667d97ac869cca62dfd17a4af43c2fa9ed68bdb /sys/dev/xen
parent1d758da82069bb1c888419a3f4d7c9cb75112b6c (diff)
downloadFreeBSD-src-a78f502d16b3bff370840e3acc8a0e659f17bb24.zip
FreeBSD-src-a78f502d16b3bff370840e3acc8a0e659f17bb24.tar.gz
Set correct maximum I/O length. We can only handle I/O of up to
max_request_segments * PAGE_SIZE if the I/O is page-aligned; the largest I/O we can guarantee will work is PAGE_SIZE less than that. This unbreaks 'diskinfo -t'.
Diffstat (limited to 'sys/dev/xen')
-rw-r--r--sys/dev/xen/blkfront/blkfront.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 8ff8757..2e08bb1 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -508,7 +508,7 @@ blkfront_initialize(struct xb_softc *sc)
sc->ring_pages = 1;
sc->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE);
sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
- sc->max_request_size = sc->max_request_segments * PAGE_SIZE;
+ sc->max_request_size = (sc->max_request_segments - 1) * PAGE_SIZE;
sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments);
/*
OpenPOWER on IntegriCloud