Bug 147373

Summary: ioctl BLKGETSIZE64 (hdparm -g) returns garbage
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: pfrields, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-07 22:29:55 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:

Description Jan Kratochvil 2005-02-07 18:28:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6)
Gecko/20050111

Description of problem:
Linux kernels detects disk/partition size correctly but
ioctl(BLKGETSIZE64) being used by hdparm(8) reports wrong number.
Software Captive NTFS fails to operate on such disks.


Version-Release number of selected component (if applicable):
kernel-2.6.10-1.760_FC3

How reproducible:
Always

Steps to Reproduce:
1. cat /sys/block/hda/size
2. hdparm -g /dev/hda


Actual Results:  398297088

/dev/hda:
 geometry     = 24792/255/63, sectors = 203928109056, start = 0


Expected Results:  398297088

/dev/hda:
 geometry     = 24792/255/63, sectors = 398297088, start = 0


Additional info:

IDE block device "struct inode"->i_size contains the bogus size info.
I expect this Linux kernel bug is not Fedora-specific.

Comment 1 Jan Kratochvil 2005-02-07 22:28:41 UTC
It is a hdparm(8) bug as it should label it "bytes", not "sectors".
BLKGETSIZE64 always returned bytes and now returns bytes.
BLKGETSIZE always returned sectors and now returns sectors.
Nothing changed.