Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 20:40:16 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216241 - head/sys/dev/xen/blkfront
Message-ID:  <201012062040.oB6KeG3V044127@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Mon Dec  6 20:40:15 2010
New Revision: 216241
URL: http://svn.freebsd.org/changeset/base/216241

Log:
  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'.

Modified:
  head/sys/dev/xen/blkfront/blkfront.c

Modified: head/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- head/sys/dev/xen/blkfront/blkfront.c	Mon Dec  6 19:15:38 2010	(r216240)
+++ head/sys/dev/xen/blkfront/blkfront.c	Mon Dec  6 20:40:15 2010	(r216241)
@@ -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);
 
 	/*



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