patch-2.1.128 linux/drivers/scsi/scsicam.c

Next file: linux/drivers/sound/Readme.modules
Previous file: linux/drivers/scsi/hosts.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.127/linux/drivers/scsi/scsicam.c linux/drivers/scsi/scsicam.c
@@ -45,6 +45,7 @@
     struct buffer_head *bh;
     int ret_code;
     int size = disk->capacity;
+    unsigned long temp_cyl;
 
     if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, 1024)))
 	return -1;
@@ -67,6 +68,11 @@
     if (ret_code || ip[0] > 255 || ip[1] > 63) {
 	 ip[0] = 64;
 	 ip[1] = 32;
+	 temp_cyl = size / (ip[0] * ip[1]);
+	 if (temp_cyl > 65534) {
+	      ip[0] = 255;
+	      ip[1] = 63;
+	 }
 	 ip[2] = size / (ip[0] * ip[1]);
     }
 

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