summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-06-09 03:56:48 +0000
committerderaadt <deraadt@openbsd.org>2007-06-09 03:56:48 +0000
commit84ac4511bc0377af63de335fab6d513a34e2b070 (patch)
tree45f49004a7d33c1da9dc138bcb34b60139d1cf8c /sys/kern/subr_disk.c
parentsync (diff)
downloadwireguard-openbsd-84ac4511bc0377af63de335fab6d513a34e2b070.tar.xz
wireguard-openbsd-84ac4511bc0377af63de335fab6d513a34e2b070.zip
be even more forceful with RAW_PART (and note this is the wrong, and temporary, place
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index c306971af06..ce110c854f7 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.52 2007/06/09 03:53:17 deraadt Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.53 2007/06/09 03:56:48 deraadt Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -198,9 +198,11 @@ disklabeltokernlabel(struct disklabel *lp)
lp->d_secperunith = 0;
}
+ /* XXX this should not be here */
if (DL_GETPOFFSET(&lp->d_partitions[RAW_PART]) != 0) {
printf("disklabeltokernlabel: Your raw partition MUST start at 0\n");
DL_SETPOFFSET(&lp->d_partitions[RAW_PART], 0);
+ DL_SETPSIZE(&lp->d_partitions[RAW_PART], DL_GETDSIZE(lp));
}
for (i = 0; i < MAXPARTITIONS; i++, pp++, v0pp++) {
@@ -211,7 +213,9 @@ disklabeltokernlabel(struct disklabel *lp)
pp->p_sizeh = 0;
}
-#ifdef notyet /* older broken sparc/sparc64 fake cyl-based disklabels fool this */
+#ifdef notyet
+ /* XXX this should not be here */
+
/* In a V1 label no partition extends past DL_GETSIZE(lp) - 1. */
if (DL_GETPOFFSET(pp) > DL_GETDSIZE(lp)) {
pp->p_fstype = FS_UNUSED;