diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-26 21:08:54 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-09-26 21:08:54 +0000 |
commit | e71a261aa387a38e76f9fa0e244fcd1480739d6d (patch) | |
tree | f39f710920981f1173856c88650fd855cf1a36b3 /sys/arch | |
parent | b0fd7a95a95d0cd1f294136ab14f392af167bd7c (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')
-rw-r--r-- | sys/arch/i386/i386/disksubr.c | 12 |
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; } } |