patch-2.2.0-pre8 linux/drivers/block/ide-disk.c

Next file: linux/drivers/block/ide-dma.c
Previous file: linux/drivers/block/ide-cd.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre7/linux/drivers/block/ide-disk.c linux/drivers/block/ide-disk.c
@@ -742,8 +742,8 @@
 	 * if possible, give fdisk access to more of the drive,
 	 * by correcting bios_cyls:
 	 */
-	if ((capacity >= (id->cyls * id->heads * id->sectors)) &&
-	    (!drive->forced_geom)) {
+	if ((capacity >= (drive->bios_cyl * drive->bios_sect * drive->bios_head)) &&
+	    (!drive->forced_geom) && drive->bios_sect && drive->bios_head) {
 		drive->bios_cyl = (capacity / drive->bios_sect) / drive->bios_head;
 #ifdef DEBUG
 		printk("Fixing Geometry :: CHS=%d/%d/%d to CHS=%d/%d/%d\n",

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov