summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-26 21:08:54 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-09-26 21:08:54 +0000
commite71a261aa387a38e76f9fa0e244fcd1480739d6d (patch)
treef39f710920981f1173856c88650fd855cf1a36b3 /sys/arch/i386
parentb0fd7a95a95d0cd1f294136ab14f392af167bd7c (diff)
Do not override sectors, track & secpercyl values set by the driver, it
is deadly if CHS addressing is used.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/disksubr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index c03fd0f46e6..f04fc7183e7 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.6 1996/09/25 11:20:13 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.7 1996/09/26 21:08:53 niklas Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -150,9 +150,13 @@ readdisklabel(dev, strat, lp, osdep)
lp->d_partitions[0].p_offset = dp->dp_start;
lp->d_partitions[RAW_PART].p_size = dp->dp_size;
lp->d_partitions[RAW_PART].p_offset = dp->dp_start;
- lp->d_ntracks = dp->dp_ehd + 1;
- lp->d_nsectors = DPSECT(dp->dp_esect);
- lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
+ if (lp->d_ntracks == 0)
+ lp->d_ntracks = dp->dp_ehd + 1;
+ if (lp->d_nsectors == 0)
+ lp->d_nsectors = DPSECT(dp->dp_esect);
+ if (lp->d_secpercyl == 0)
+ lp->d_secpercyl = lp->d_ntracks *
+ lp->d_nsectors;
}
}