lkml.org 
[lkml]   [1996]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject1.3.86 SCSI disc size info overflow (+fix)
Date
Hi,

For my 4.3GB (4.1 formatted) disc I see the following during boot:

SCSI device sda: hdwr sector= 512 bytes. Sectors= 3450902 [1685 MB] [1.7 GB]
SCSI device sdb: hdwr sector= 512 bytes. Sectors= 2050860 [1001 MB] [1.0 GB]
SCSI device sdc: hdwr sector= 512 bytes. Sectors= 8399520 [5 MB] [0.0 GB]

Hmm.. a 5 MB hard disc :-). After looking at sd.c I reordered the MB
calculation as follows:

--- linux-1.3.86/drivers/scsi/sd.c.orig Wed Apr 10 18:13:18 1996
+++ linux-1.3.86/drivers/scsi/sd.c Wed Apr 10 19:11:27 1996
@@ -1168,7 +1168,7 @@
for (m=i<<4; m<((i+1)<<4); m++){
sd_hardsizes[m] = hard_sector;
}
- mb = (hard_sector * rscsi_disks[i].capacity) / (1024*1024);
+ mb = rscsi_disks[i].capacity / 1024 * hard_sector / 1024;
/* sz = div(m/100, 10); this seems to not be in the libr */
m = (mb + 50) / 100;
sz_quot = m / 10;
Now I see:

SCSI device sda: hdwr sector= 512 bytes. Sectors= 3450902 [1685 MB] [1.7 GB]
SCSI device sdb: hdwr sector= 512 bytes. Sectors= 2050860 [1001 MB] [1.0 GB]
SCSI device sdc: hdwr sector= 512 bytes. Sectors= 8399520 [4101 MB] [4.1 GB]

Regards,
Julian
--
Julian Thompson (jrt@miel.demon.co.uk)


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.023 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site