summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2005-11-17 21:25:58 +0000
committerkrw <krw@openbsd.org>2005-11-17 21:25:58 +0000
commit80352d8fe1fc3174ffb41946f9e93645df82b4ac (patch)
treef504489936b8286fea2f0b1058cf2a3d81e1421a /sys
parenttypo, ok hshoexer@ (diff)
downloadwireguard-openbsd-80352d8fe1fc3174ffb41946f9e93645df82b4ac.tar.xz
wireguard-openbsd-80352d8fe1fc3174ffb41946f9e93645df82b4ac.zip
Use sectors as the size units for the RAW_PART (i.e. 'c') partition in
spoofed sd disklabels. Sectors are the partition size units used and documented everywhere else in the tree. sd ensures a sector will always be a multiple of 512. Fixes disklabel(8) error messages and partition size display for sd devices that have no OpenBSD disklabel and a sectorsize > 512. Noted by Robert Szasz on his Sony Hi-MD device. ok pedro@ marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index f6ba3f2f365..1b00e577c6b 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.98 2005/11/13 16:10:05 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.99 2005/11/17 21:25:58 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -1020,8 +1020,7 @@ sdgetdisklabel(dev, sd, lp, clp, spoofonly)
lp->d_sbsize = SBSIZE;
lp->d_partitions[RAW_PART].p_offset = 0;
- lp->d_partitions[RAW_PART].p_size =
- lp->d_secperunit * (lp->d_secsize / DEV_BSIZE);
+ lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED;
lp->d_npartitions = RAW_PART + 1;