PROBLEM: drivers/scsi/sd.c - Incorrect Reporting of Blocks and Capacity of Large SCSI Disk Arrays

PROBLEM: drivers/scsi/sd.c - Incorrect Reporting of Blocks and Capacity of Large SCSI Disk Arrays

Post by James Bourn » Fri, 31 Jan 2003 22:10:15



I have attempt to fill out the Bug Report as per REPORTING-BUGS. I have
attempted to forward the report to the respective authors of the appropriate
module but the email bounced (-> er...@andante.org, d...@colorado.edu).
Please let me know if I can be of further assistance.

Regards,

James

1. drivers/scsi/sd.c - Incorrect Reporting of Blocks and Capacity of Large
SCSI Disk Arrays

2. The size of very large SCSI Disk arrays is incorrectly reported by code
in 'drivers/scsi/sd.c' as a result of perhaps inadequate precision of field
'capacity' in structure: 'typedef struct scsi_disk' found in drives/scsi/sd.h.

This problem exists on both a custom 2.4.20 kernel and on a stock RedHat
2.4.18-19.8.0smp kernel. This problem report pertains to the latter kernel.

For example:

SCSI device sdb: -562247552 512-byte hdwr sectors (4294679426 MB)
 sdb: sdb1
SCSI device sdc: -1997908992 512-byte hdwr sectors (76582 MB)
 sdc: sdc1

Server:
   IBM xSeries 220 (2 x PIII 1Ghz, 512MB RAM)
HBAs:
   Onboard Adaptec HBA to 1 x 36GB HDD
   Offboard Adaptec AHA39160 HBA in slot 4 (64-bit/33Mhz)
Channels:
   Channel A connected to Adaptec Durstor 6220SS
   Channel B connected to Quantum ATL 1500 (2 x SDLT320, 20-slots)
Storage:
   Adaptec Durstor 6220SS Connected to 3 Adaptec 312R JBODs
   Each JBOD populated with 8 x 147GB Fujitsu HDD (MAP3147NC)
RAID:
   RAID-3 Array 1 created comprising 14 x HDD (@ 140201MB per spindle)
   RAID-3 Array 2 created comprising 9 x HDD (@ 140201MB per spindle)
Spares:
   One pool spare allocated
Array Capacity
   Total unformatted capacity for Array 1: 1962814MB (1916.81GB, 1.87TB)
   Total unformatted capacity for Array 2: 1261809MB (1232.23GB, 1.20TB)
Partition
   Array 1: Single Partition
   Array 2: Single Partition
FileSystem:
   Array 1: EXT3
   Array 2: EXT3

3. scsi, modules, kernel

4. Linux version 2.4.18-19.8.0smp (bhcomp...@stripples.devel.redhat.com) (gcc
version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 SMP Thu Dec 12 04:36:25
EST 2002

5. From dmesg:

SCSI subsystem driver Revision: 1.00
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.8
       <Adaptec aic7892 Ultra160 SCSI adapter>
       aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs

scsi1 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.8
       <Adaptec 3960D Ultra160 SCSI adapter>
       aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs

scsi2 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.8
       <Adaptec 3960D Ultra160 SCSI adapter>
       aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs

blk: queue c251a618, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: IBM-PSG   Model: DDYS-T36950M  M   Rev: S9HA
 Type:   Direct-Access                      ANSI SCSI revision: 03
blk: queue c251a418, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: IBM       Model: YGLv3 S2          Rev: 0  
 Type:   Processor                          ANSI SCSI revision: 02
blk: queue dfd1be18, I/O limit 4095Mb (mask 0xffffffff)
scsi0:A:0:0: Tagged Queuing enabled.  Depth 253
blk: queue dfd1be18, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: Adaptec   Model: DuraStor 6200S    Rev: L421
 Type:   Direct-Access                      ANSI SCSI revision: 03
blk: queue dfd01218, I/O limit 4095Mb (mask 0xffffffff)
scsi1:A:1:0: Tagged Queuing enabled.  Depth 253
blk: queue dfd01218, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: M4 DATA   Model: MagFile           Rev: 3.01
 Type:   Medium Changer                     ANSI SCSI revision: 02
blk: queue dfce5818, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: QUANTUM   Model: SDLT320           Rev: 2E2E
 Type:   Sequential-Access                  ANSI SCSI revision: 02
blk: queue dfce5418, I/O limit 4095Mb (mask 0xffffffff)
 Vendor: QUANTUM   Model: SDLT320           Rev: 2E2E
 Type:   Sequential-Access                  ANSI SCSI revision: 02
blk: queue dfce5018, I/O limit 4095Mb (mask 0xffffffff)
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi1, channel 0, id 1, lun 0
(scsi0:A:0): 160.000MB/s transfers (80.000MHz DT, offset 63, 16bit)
SCSI device sda: 71096640 512-byte hdwr sectors (36401 MB)
Partition check:
sda: sda1 sda2 sda3
(scsi1:A:1): 160.000MB/s transfers (80.000MHz DT, offset 127, 16bit)
SCSI device sdb: -562247552 512-byte hdwr sectors (-287870 MB)

6. N/a

7. Environment

7.1 Software

ver_linux:

Linux firedaemon 2.4.18-19.8.0smp #1 SMP Thu Dec 12 04:36:25 EST 2002 i686
i686 i386 GNU/Linux

Gnu C                  3.2
Gnu make               3.79.1
util-linux             2.11r
mount                  2.11r
modutils               2.4.18
e2fsprogs              1.27
jfsutils               1.0.17
reiserfsprogs          3.6.2
pcmcia-cs              3.1.31
PPP                    2.4.1
isdn4k-utils           3.1pre4
Linux C Library        2.2.93
Dynamic linker (ldd)   2.2.93
Procps                 2.0.7
Net-tools              1.60
Kbd                    1.06
Sh-utils               2.0.12
Modules Loaded         sg nfsd lockd sunrpc sk98lin e100 iptable_filter
ip_tables st mousedev keybdev hid input usb-ohci usbcore ext3 jbd aic7xxx
sd_mod scsi_mod

7.2 Processor Info

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 10
cpu MHz         : 999.753
cache size      : 256 KB
Physical processor ID   : 0
Number of siblings      : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 mmx fxsr sse
bogomips        : 1985.67

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 10
cpu MHz         : 999.753
cache size      : 256 KB
Physical processor ID   : 0
Number of siblings      : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 mmx fxsr sse
bogomips        : 1997.32

7.3 Modules

sg                     37644   0 (autoclean)
nfsd                   81424   8 (autoclean)
lockd                  58800   1 (autoclean) [nfsd]
sunrpc                 84604   1 (autoclean) [nfsd lockd]
sk98lin               138624   1
e100                   64596   1
iptable_filter          2412   0 (autoclean) (unused)
ip_tables              15640   1 [iptable_filter]
st                     31440   0 (unused)
mousedev                5688   1
keybdev                 2976   0 (unused)
hid                    22404   0 (unused)
input                   6240   0 [mousedev keybdev hid]
usb-ohci               22088   0 (unused)
usbcore                80512   1 [hid usb-ohci]
ext3                   72960   3
jbd                    56752   3 [ext3]
aic7xxx               138452   4
sd_mod                 13552   8
scsi_mod              110408   4 [sg st aic7xxx sd_mod]

7.4 Loaded Driver/Hardware Info

0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
01f0-01f7 : ide0
03c0-03df : vga+
03f6-03f6 : ide0
03f8-03ff : serial(auto)
0700-070f : ServerWorks OSB4 IDE Controller
 0700-0707 : ide0
 0708-070f : ide1
0cf8-0cff : PCI conf1
2200-223f : Intel Corp. 82557/8/9 [Ethernet Pro 100]
 2200-223f : e100
2300-23ff : Adaptec AIC-7892P U160/m
2400-24ff : Adaptec AHA-3960D / AIC-7899A U160/m
2500-25ff : Adaptec AHA-3960D / AIC-7899A U160/m (#2)
2600-26ff : Syskonnect (Schneider & Koch) Gigabit Ethernet

00000000-0009dbff : System RAM
0009dc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000ca000-000ce7ff : Extension ROM
000f0000-000fffff : System ROM
00100000-1ffebc3f : System RAM
 00100000-0026af59 : Kernel code
 0026af5a-00375f03 : Kernel data
1ffebc40-1ffeffff : ACPI Tables
1fff0000-1fffffff : reserved
efff8000-efffbfff : Syskonnect (Schneider & Koch) Gigabit Ethernet
efffd000-efffdfff : Adaptec AHA-3960D / AIC-7899A U160/m (#2)
 efffd000-efffdfff : aic7xxx
efffe000-efffefff : Adaptec AHA-3960D / AIC-7899A U160/m
 efffe000-efffefff : aic7xxx
effff000-efffffff : Adaptec AIC-7892P U160/m
 effff000-efffffff : aic7xxx
f0000000-f7ffffff : S3 Inc. Savage 4
fea00000-feafffff : Intel Corp. 82557/8/9 [Ethernet Pro 100]
 fea00000-feafffff : e100
feb7e000-feb7efff : ServerWorks OSB4/CSB5 OHCI USB Controller
 feb7e000-feb7efff : usb-ohci
feb7f000-feb7ffff : Intel Corp. 82557/8/9 [Ethernet Pro 100]
 feb7f000-feb7ffff : e100
feb80000-febfffff : S3 Inc. Savage 4
fec00000-ffffffff : reserved

7.5 PCI Information

00:00.0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B-
       Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium  >TAbort-
<TAbort-  <MAbort+  >SERR-  <PERR-
       Latency: 64, cache line size 08

00:00.1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+
Stepping- SERR+ FastB2B-
       Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium  >TAbort-
<TAbort-  <MAbort-  >SERR-  <PERR-
       Latency: 64, cache line size 08

00:01.0 VGA compatible controller: S3 Inc. Savage 4 (rev 04) (prog-if 00
[VGA])
       Subsystem: IBM: Unknown device 01c5
       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
       Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium  >TAbort-
<TAbort-  <MAbort-  >SERR-  <PERR-
       Latency: 248 (1000ns min, 63750ns max), cache line size 08
       Interrupt: pin A routed to IRQ 0
       Region 0: Memory at feb80000 (32-bit, non-prefetchable) [size=512K]
...

read more »

 
 
 

PROBLEM: drivers/scsi/sd.c - Incorrect Reporting of Blocks and Capacity of Large SCSI Disk Arrays

Post by Andries.Brou.. » Sat, 01 Feb 2003 01:50:14



|
| drivers/scsi/sd.c - Incorrect Reporting of Blocks and Capacity of Large
| SCSI Disk Arrays
|
| This problem exists on both a custom 2.4.20 kernel and on a stock RedHat
| 2.4.18-19.8.0smp kernel. This problem report pertains to the latter kernel.
|
| For example:
|
| SCSI device sdb: -562247552 512-byte hdwr sectors (4294679426 MB)
|  sdb: sdb1
| SCSI device sdc: -1997908992 512-byte hdwr sectors (76582 MB)
|  sdc: sdc1
|
| Array Capacity
|    Total unformatted capacity for Array 1: 1962814MB (1916.81GB, 1.87TB)
|    Total unformatted capacity for Array 2: 1261809MB (1232.23GB, 1.20TB)
-----

Please try the patch below.
Andries

----------------------------------------------------------------
From aeb  Fri Dec 13 00:15:47 2002

Subject: Re: using 2 TB  in real life

Content-Length: 974

Quote:> SCSI device sdb: -320126976 512-byte hdwr sectors (-163904 MB)

Yes, the code in 2.4.20 works up to 30 bits.
A slight modification works up to 31 bits.
[This is cosmetic only.]

Andries

--- /linux/2.4/linux-2.4.20/linux/drivers/scsi/sd.c     Sat Aug  3 02:39:44 2002

                         */
                        int m;
                        int hard_sector = sector_size;
-                       int sz = rscsi_disks[i].capacity * (hard_sector/256);
+                       unsigned int sz = (rscsi_disks[i].capacity/2) * (hard_sector/256);

                        /* There are 16 minors allocated for each major device */

                        }

                        printk("SCSI device %s: "
-                              "%d %d-byte hdwr sectors (%d MB)\n",
+                              "%u %d-byte hdwr sectors (%u MB)\n",
                               nbuff, rscsi_disks[i].capacity,
-                              hard_sector, (sz/2 - sz/1250 + 974)/1950);
+                              hard_sector, (sz - sz/625 + 974)/1950);
                }

                /* Rescale capacity to 512-byte units */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Regarding documentation of sd[SCSI disk]driver

Hi,
  I find a very good documentaion about SCSI generic[sg] driver but
couldn't get much info about scsi disk[sd] driver.
  Can anyone let me know the resources from where i can get good
documentation about scsi disk driver[One of Four high level drivers in
Linux SCSI subsystem].

Thanks in advance,

Regards,
Prashanth

2. Linux port to Be box info

3. CDEJECT for SCSI disks/ide-floppy in drivers/block/scsi_ioctl.c

4. Red Hat Linux - Convert Monochrome install to Color?

5. weird: only half capacity after SCSI block size change

6. Linux XFree86 HOWTO

7. SCSI disk array problem

8. Mary Jane Worm for WINTROLLS ONLY!

9. Limiting the SCSI I/O size at sd target driver level

10. Problem with ext2 fs on large SCSI disk?

11. A bug in drivers/scsi/sd.c

12. Large SCSI disk installation problem

13. Large SCSI Hard disk problem