svn commit: r246307 - projects/virtio/sys/dev/virtio/block
Bryan Venteicher
bryanv at FreeBSD.org
Sun Feb 3 23:35:54 UTC 2013
Author: bryanv
Date: Sun Feb 3 23:35:53 2013
New Revision: 246307
URL: http://svnweb.freebsd.org/changeset/base/246307
Log:
virtio_blk: Correct stripe offset calculation
Pointed out by: max
Approved by: grehan (implicit)
Modified:
projects/virtio/sys/dev/virtio/block/virtio_blk.c
Modified: projects/virtio/sys/dev/virtio/block/virtio_blk.c
==============================================================================
--- projects/virtio/sys/dev/virtio/block/virtio_blk.c Sun Feb 3 23:35:05 2013 (r246306)
+++ projects/virtio/sys/dev/virtio/block/virtio_blk.c Sun Feb 3 23:35:53 2013 (r246307)
@@ -725,8 +725,9 @@ vtblk_alloc_disk(struct vtblk_softc *sc,
if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) {
dp->d_stripesize = dp->d_sectorsize *
(1 << blkcfg->topology.physical_block_exp);
- dp->d_stripeoffset = dp->d_sectorsize *
- blkcfg->topology.alignment_offset;
+ dp->d_stripeoffset = (dp->d_stripesize -
+ blkcfg->topology.alignment_offset * dp->d_sectorsize) %
+ dp->d_stripesize;
}
if (vtblk_write_cache_enabled(sc, blkcfg) != 0)
More information about the svn-src-projects
mailing list