diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c index b79370d6326e..4172319ab4a3 100644 --- a/usr.sbin/bhyve/pci_virtio_block.c +++ b/usr.sbin/bhyve/pci_virtio_block.c @@ -311,7 +311,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) } assert(size != 0); assert(sectsz != 0); - if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0) + if (ioctl(fd, DIOCGSTRIPESIZE, &sts) == 0 && sts > 0) ioctl(fd, DIOCGSTRIPEOFFSET, &sto); } else sts = sbuf.st_blksize;