Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 158930

Summary: 32-bit GETBLKSIZE ioctl overflows incorrectly on 64-bit hosts.
Product: Red Hat Enterprise Linux 4 Reporter: Stephen Tweedie <sct>
Component: kernelAssignee: Stephen Tweedie <sct>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: poelstra, rkenna
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2005-514 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-05 13:18:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 156322    
Attachments:
Description Flags
Fix EFBIG for 32-bit GETBLKSIZE ioctl compatibility none

Description Stephen Tweedie 2005-05-26 22:43:59 UTC
Description of problem:

The 32-bit compatibility GETBLKSIZE ioctl on 64-bit kernels truncates the 64-bit
long return value to 32-bits.  Unfortunately, this wraps back to zero at the 2TB
point, returning an incorrect device size.  On a 32-bit kernel, the ioctl
returns an EFBIG error on such an overflow, allowing the application to fall
back on an alternative method of determining the device size (such as the
GETBLKSIZE64 ioctl.)

Version-Release number of selected component (if applicable):

kernel-2.6.9-6.37.EL

How reproducible:
100%

Steps to Reproduce:
1. Run the "verify-data" tool with "verify-data -Q /dev/$dev" on a device larger
than 2TB
(see http://people.redhat.com/sct/src/verify-data/ )

Actual results:
GETBLKSIZE returns incorrect size

Expected results:
GETBLKSIZE returns EFBIG

Comment 1 Stephen Tweedie 2005-05-26 22:45:14 UTC
This has only been seen in internal testing of >2TB devices.  It will be
encountered any time a 32-bit application attempts to determine device size on a
64-bit kernel for devices >2TB.

Comment 2 Stephen Tweedie 2005-05-26 22:50:11 UTC
Created attachment 114897 [details]
Fix EFBIG for 32-bit GETBLKSIZE ioctl compatibility

Comment 12 Red Hat Bugzilla 2005-10-05 13:18:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-514.html