[PATCH RFC] fix mpt fustion cylinders calculation for large disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mptscsih will cast a sector_t to an int which is causing cylinders
to be zero in some cases. This patch just sets cylinders to the
max value when the capacity is over the limit that the geometry
struct can support. With the patch if access a large Fibre Channel
disk using Emulex on a 64 bit system I get the same values as mpt fusion,
but I am honestly not sure why mpt does their own geometry calculations
for this case in the first place so I am only sending this as a
RFC.

Also, I thought cylinders could be ignored by userspace but I am
not sure where I read this and cannot seem to find it, so
I ccd Andries who seems to post the most about such things
(chances are they said it and I am misquiting them).

Patch was made against the scsi-misc tree.

--- scsi-misc.sense/drivers/message/fusion/mptscsih.c.orig	2005-07-25 16:17:24.000000000 -0500
+++ scsi-misc.sense/drivers/message/fusion/mptscsih.c	2005-07-25 16:17:39.000000000 -0500
@@ -2107,12 +2107,17 @@ mptscsih_bios_param(struct scsi_device *
 	 * Handle extended translation size for logical drives
 	 * > 1Gb
 	 */
-	if ((ulong)capacity >= 0x200000) {
+	if (capacity >= 0x200000) {
 		heads = 255;
 		sectors = 63;
 		dummy = heads * sectors;
-		cylinders = capacity;
-		sector_div(cylinders,dummy);
+
+		if (capacity > 65535 * 63 * 255)
+			cylinders = 65535;
+		else {
+			cylinders = capacity;
+			sector_div(cylinders,dummy);
+		}
 	}
 
 	/* return result */


-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux