Bug 116699 - large block device (> 1TB) has negative size
large block device (> 1TB) has negative size
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
2.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Don Howard
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-24 10:13 EST by Peter J. Holzer
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-12 12:55:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter J. Holzer 2004-02-24 10:13:11 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116

Description of problem:
We have a large (ca. 1.5 TB) external disk array attached to an
AIC-7899 SCSI HBA.

Relevant excerpts from boot messages:

SCSI subsystem driver Revision: 1.00
[...]
(scsi1) <Adaptec AIC-7899 Ultra 160/m SCSI host adapter> found at PCI
3/2/1
(scsi1) Wide Channel B, SCSI ID=7, 32/255 SCBs
(scsi1) Downloading sequencer code... 396 instructions downloaded
[...]
scsi1 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.5/5.2.0
       <Adaptec AIC-7899 Ultra 160/m SCSI host adapter>
[...]
  Vendor: transtec  Model:                   Rev: 0001
  Type:   Direct-Access                      ANSI SCSI revision: 03
[...]
Attached scsi disk sdc at scsi1, channel 0, id 0, lun 0
[...]
(scsi1:0:0:0) Synchronous at 160.0 Mbyte/sec, offset 31.
SCSI device sdc: -1012908032 512-byte hdwr sectors (-518608 MB)
 sdc: sdc1

So the kernel thinks the device has a negative size.

Any attempt to read from the device returns EOF after 0 bytes:

[root@ryqvy root]# dd if=/dev/sdc of=/dev/null count=1
0+0 records in
0+0 records out
[root@ryqvy root]# cat < /dev/sdc
[root@ryqvy root]# uname -a
Linux ryqvy.wsr.ac.at 2.4.9-e.38smp #1 SMP Wed Feb 11 00:09:01 EST
2004 i686 unknown

The machine was previously running Redhat Linux 7.3 (with a recent
kernel) for about half a year without problems, so the problem has
been fixed in 2.4.20.




Version-Release number of selected component (if applicable):
2.4.9-e.38

How reproducible:
Always

Steps to Reproduce:
1. Attach SCSI device > 1 TB to Adaptec SCSI adapter
2. Boot
3. Look at reported size in boot messages and try to read from device
    

Actual Results:  Negative size, device cannot be read.

Expected Results:  Positive size matching the actual size of the
device, device can be read (and written).

Additional info:
Comment 1 Peter J. Holzer 2004-02-24 11:39:12 EST
I think I found the relevant patch:

ChangeLog-2.4.13 mentions:

 - Leonard Zubkoff: 2TB disk device fixes

and the patch changes start_sect and nr_sects in struct hd_struct from
long to unsigned long. (linux/include/linux/genhd.h).
Comment 2 Peter J. Holzer 2004-02-24 13:12:56 EST
I applied only the changes to hd_struct and ignored all the changes in
put_user calls (AFAICS they are only cosmetic, as an unsigned long has
the same size as a signed long). This seems to do the trick. I can
access the device and mount the filesystem (haven't tried more yet).
Comment 3 Peter J. Holzer 2005-02-10 15:41:18 EST
I just noticed a strange behaviour in the current kernel
(2.4.9-e.59smp): fdisk -l fails on the large device (a read from
/dev/sdc returns 0 bytes), but the ext3 file system on /dev/sdc1 can
be mounted and seems to work (I haven't tried to read all 1.6 TB, though).
Comment 4 Don Howard 2006-09-11 19:51:06 EDT
Is this issue still present in -e.70?  I see that the mentioned fields in
hd_struct are still signed, so I would expect that the problem persists.
Comment 5 Peter J. Holzer 2006-09-12 04:02:33 EDT
We upgraded the server in question to RHEL 3 a few months ago, so I can't check
anymore, sorry.

Since we seem to have been the only ones who ever tried to use devices > 1TB
with RHEL 2.1 and we moved everything to RHEL 3 and later now, I guess the bug
can be closed.
Comment 6 Don Howard 2006-09-12 12:55:32 EDT
Ah, after reviewing 2.1 product documentation, I noticed that 1TB is the
supported limit for block devices in RHEL2.1.  Moving to RHEL3 was your best
bet.  Thanks for the response.

Note You need to log in before you can comment on or make changes to this bug.