Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2012 12:01:14 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239294 - head/sys/boot/common
Message-ID:  <201208151201.q7FC1Ewm050975@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208151201.q7FC1Ewm050975>