diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1997-05-11 12:48:33 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1997-05-11 12:48:33 +0000 |
| commit | 2d0ae92a99a5449092d3bcdb5a8b5df039baecb1 (patch) | |
| tree | d82d1364c21f7c1e6033b9645f29a49ddac69885 /sys | |
| parent | ec6ceacea22f638d36ae6e11ce4773222f054b9a (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/i386/isa/diskslice_machdep.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/i386/isa/diskslice_machdep.c b/sys/i386/isa/diskslice_machdep.c index 509b05aac0a0..4625058e4034 100644 --- a/sys/i386/isa/diskslice_machdep.c +++ b/sys/i386/isa/diskslice_machdep.c @@ -35,7 +35,7 @@ * * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ - * $Id: diskslice_machdep.c,v 1.21 1996/09/20 17:39:11 bde Exp $ + * $Id: diskslice_machdep.c,v 1.21.2.1 1996/11/06 10:33:24 phk Exp $ */ #include <stddef.h> @@ -100,14 +100,16 @@ check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) /* * If ssector1 is on a cylinder >= 1024, then ssector can't be right. * Allow the C/H/S for it to be 1023/ntracks-1/nsectors, or correct - * apart from the cylinder being reduced modulo 1024. + * apart from the cylinder being reduced modulo 1024. Always allow + * 1023/255/63. */ if (ssector < ssector1 && ((chs_ssect == nsectors && dp->dp_shd == ntracks - 1 && chs_scyl == 1023) - || (ssector1 - ssector) % (1024 * secpercyl) == 0) - || (dp->dp_scyl == 255 && dp->dp_shd == 255 - && dp->dp_ssect == 255)) { + || (secpercyl != 0 + && (ssector1 - ssector) % (1024 * secpercyl) == 0)) + || (dp->dp_scyl == 255 && dp->dp_shd == 255 + && dp->dp_ssect == 255)) { TRACE(("%s: C/H/S start %d/%d/%d, start %lu: allow\n", sname, chs_scyl, dp->dp_shd, chs_ssect, ssector1)); ssector = ssector1; @@ -123,9 +125,10 @@ check_part(sname, dp, offset, nsectors, ntracks, mbr_offset ) if (esector < esector1 && ((chs_esect == nsectors && dp->dp_ehd == ntracks - 1 && chs_ecyl == 1023) - || (esector1 - esector) % (1024 * secpercyl) == 0) - || (dp->dp_ecyl == 255 && dp->dp_ehd == 255 - && dp->dp_esect == 255)) { + || (secpercyl != 0 + && (esector1 - esector) % (1024 * secpercyl) == 0)) + || (dp->dp_ecyl == 255 && dp->dp_ehd == 255 + && dp->dp_esect == 255)) { TRACE(("%s: C/H/S end %d/%d/%d, end %lu: allow\n", sname, chs_ecyl, dp->dp_ehd, chs_esect, esector1)); esector = esector1; |
