Author: ae
Date: Wed Aug 15 12:01:13 2012
New Revision: 239294
URL: http://svn.freebsd.org/changeset/base/239294

Log:
  Some BIOSes return incorrect number of sectors, make checks less
  strictly, to do not lost some partitions.
  
  Reported by:  swills@

Modified:
  head/sys/boot/common/part.c

Modified: head/sys/boot/common/part.c
==============================================================================
--- head/sys/boot/common/part.c Wed Aug 15 10:11:29 2012        (r239293)
+++ head/sys/boot/common/part.c Wed Aug 15 12:01:13 2012        (r239294)
@@ -372,8 +372,10 @@ ptable_ebrread(struct ptable *table, voi
        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, ui
                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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to