From a78f502d16b3bff370840e3acc8a0e659f17bb24 Mon Sep 17 00:00:00 2001 From: cperciva Date: Mon, 6 Dec 2010 20:40:15 +0000 Subject: 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'. --- sys/dev/xen/blkfront/blkfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/xen') 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); /* -- cgit v1.1