diff options
author | ae <ae@FreeBSD.org> | 2012-08-15 12:01:13 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2012-08-15 12:01:13 +0000 |
commit | 0923bbf433f78fddbf918f2aee2d0b9da5a91306 (patch) | |
tree | 1ac6fc967e10b92418c2b42a410182a2701e1d7c /sys/boot/common | |
parent | 3a3516f682aed16fb4e0dde60a18ec33b225ed68 (diff) | |
download | FreeBSD-src-0923bbf433f78fddbf918f2aee2d0b9da5a91306.zip FreeBSD-src-0923bbf433f78fddbf918f2aee2d0b9da5a91306.tar.gz |
Some BIOSes return incorrect number of sectors, make checks less
strictly, to do not lost some partitions.
Reported by: swills@
Diffstat (limited to 'sys/boot/common')
-rw-r--r-- | sys/boot/common/part.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/boot/common/part.c b/sys/boot/common/part.c index ac1596d..28c8b79 100644 --- a/sys/boot/common/part.c +++ b/sys/boot/common/part.c @@ -372,8 +372,10 @@ ptable_ebrread(struct ptable *table, void *dev, diskread_t dread) if (buf == NULL) return (table); for (i = 0; i < MAXEBRENTRIES; i++) { +#if 0 if (offset >= table->sectors) break; +#endif if (dread(dev, buf, 1, offset) != 0) break; dp = (struct dos_partition *)(buf + DOSPARTOFF); @@ -663,8 +665,10 @@ ptable_open(void *dev, off_t sectors, uint16_t sectorsize, end = le32toh(dp[i].dp_size); if (start == 0 || end == 0) continue; +#if 0 if (start + end - 1 >= sectors) continue; /* XXX: ignore */ +#endif if (dp[i].dp_typ == DOSPTYP_EXT || dp[i].dp_typ == DOSPTYP_EXTLBA) has_ext = 1; |