svn commit: r337317 - head/stand/i386/libi386

Xin LI delphij at FreeBSD.org
Sat Aug 4 14:13:10 UTC 2018


Author: delphij
Date: Sat Aug  4 14:13:09 2018
New Revision: 337317
URL: https://svnweb.freebsd.org/changeset/base/337317

Log:
  In r337271, we limited the sector number to the lower of calculated
  number and CHS based number.  However, on some systems, BIOS would
  report 0 in CHS fields, making the system to think there is 0 sectors.
  
  Add a check before comparing the calculated total with bd_sectors.
  
  Reviewed by:	tsoome, cy
  Differential Revision:	https://reviews.freebsd.org/D16577

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==============================================================================
--- head/stand/i386/libi386/biosdisk.c	Sat Aug  4 13:57:50 2018	(r337316)
+++ head/stand/i386/libi386/biosdisk.c	Sat Aug  4 14:13:09 2018	(r337317)
@@ -275,7 +275,7 @@ bd_int13probe(struct bdinfo *bd)
 
 		total = (uint64_t)params.cylinders *
 		    params.heads * params.sectors_per_track;
-		if (bd->bd_sectors > total)
+		if (total > 0 && bd->bd_sectors > total)
 			bd->bd_sectors = total;
 
 		ret = 1;


More information about the svn-src-head mailing list