Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Aug 2018 14:13:09 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337317 - head/stand/i386/libi386
Message-ID:  <201808041413.w74ED9Yd015020@repo.freebsd.org>

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



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