Bug 147373 - ioctl BLKGETSIZE64 (hdparm -g) returns garbage
ioctl BLKGETSIZE64 (hdparm -g) returns garbage
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2005-02-07 13:28 EST by Jan Kratochvil
Modified: 2015-01-04 17:16 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-02-07 17:29:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2005-02-07 13:28:06 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6)

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):

How reproducible:

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

Actual Results:  398297088

 geometry     = 24792/255/63, sectors = 203928109056, start = 0

Expected Results:  398297088

 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 17:28:41 EST
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.

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