Bug 116699 - large block device (> 1TB) has negative size
Summary: large block device (> 1TB) has negative size
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 2.1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Don Howard
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2004-02-24 15:13 UTC by Peter J. Holzer
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

Description Peter J. Holzer 2004-02-24 15:13:11 UTC
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

Relevant excerpts from boot messages:

SCSI subsystem driver Revision: 1.00
(scsi1) <Adaptec AIC-7899 Ultra 160/m SCSI host adapter> found at PCI
(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):

How reproducible:

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 16:39:12 UTC
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 18:12:56 UTC
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 20:41:18 UTC
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 23:51:06 UTC
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 08:02:33 UTC
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 16:55:32 UTC
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.