summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-04-18 19:37:37 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-04-18 19:37:37 +0000
commit18c5ed7145f044995c62ce9d3b1890664a50f0ef (patch)
tree670dd0133e592adafe19532f88eeabc5fc4420df
parent4cae2db2a89ed89cf607e3c598f5eb077ef2c8f7 (diff)
Notes
-rw-r--r--sys/dev/virtio/block/virtio_blk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
index 28a363b88e0a..0cfebf1d724c 100644
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -710,7 +710,8 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg)
dp->d_fwheads = blkcfg->geometry.heads;
}
- if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) {
+ if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) &&
+ blkcfg->topology.physical_block_exp > 0) {
dp->d_stripesize = dp->d_sectorsize *
(1 << blkcfg->topology.physical_block_exp);
dp->d_stripeoffset = (dp->d_stripesize -