diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-16 12:19:08 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-16 12:19:08 +0000 |
commit | 656ec949ef35f405821763e253ac9fc5dadc2a13 (patch) | |
tree | 669e9525207a5f3792f421fbafbd3662e59c0521 | |
parent | 2e2a66f9cb244be69293dc8e660addbba2180722 (diff) |
byteswap the number of blocks on physical disks for bioctl correctly.
makes output sane on sparc64 and other BE archs.
found by jason george
-rw-r--r-- | sys/dev/ic/mpi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 6575612ebc1..e1115661f91 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.141 2010/04/16 01:10:19 deraadt Exp $ */ +/* $OpenBSD: mpi.c,v 1.142 2010/04/16 12:19:07 dlg Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org> @@ -2958,7 +2958,7 @@ mpi_ioctl_disk(struct mpi_softc *sc, struct bioc_disk *bd) bd->bd_channel = pdpg0.phys_disk_bus; bd->bd_target = pdpg0.phys_disk_id; bd->bd_lun = 0; - bd->bd_size = (u_quad_t)pdpg0.max_lba * 512; + bd->bd_size = (u_quad_t)letoh32(pdpg0.max_lba) * 512; strlcpy(bd->bd_vendor, pdpg0.vendor_id, sizeof(bd->bd_vendor)); switch (pdpg0.phys_disk_state) { |