svn commit: r197457 - stable/8/lib/libdisk

Takahashi Yoshihiro nyan at FreeBSD.org
Thu Sep 24 15:34:19 UTC 2009


Author: nyan
Date: Thu Sep 24 15:34:18 2009
New Revision: 197457
URL: http://svn.freebsd.org/changeset/base/197457

Log:
  MFC: r197322 and r197374
  
    Revision: 197322
    Log:
      Correct BIOS header sanitizing on pc98.
  
    Revision: 197374
    Log:
      Disable a check on a disk size because it's too strict.  This change is
      to avoid using incorrect geometry.
  
     It seems that this is the same problem in g_part_bsd_read()@g_part_bsd.c.
  
     Reviewed by: rink
  
  Approved by:	re (kib)

Modified:
  stable/8/lib/libdisk/   (props changed)
  stable/8/lib/libdisk/change.c

Modified: stable/8/lib/libdisk/change.c
==============================================================================
--- stable/8/lib/libdisk/change.c	Thu Sep 24 14:30:17 2009	(r197456)
+++ stable/8/lib/libdisk/change.c	Thu Sep 24 15:34:18 2009	(r197457)
@@ -36,17 +36,22 @@ Sanitize_Bios_Geom(struct disk *disk)
 
 	if (disk->bios_cyl >= 65536)
 		sane = 0;
-	if (disk->bios_hd > 256)
-		sane = 0;
 #ifdef PC98
+	if (disk->bios_hd >= 256)
+		sane = 0;
 	if (disk->bios_sect >= 256)
+		sane = 0;
 #else
+	if (disk->bios_hd > 256)
+		sane = 0;
 	if (disk->bios_sect > 63)
-#endif
 		sane = 0;
+#endif
+#if 0	/* Disable a check on a disk size.  It's too strict. */
 	if (disk->bios_cyl * disk->bios_hd * disk->bios_sect !=
 	    disk->chunks->size)
 		sane = 0;
+#endif
 	if (sane)
 		return;
 


More information about the svn-src-stable-8 mailing list