Bug 238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors
Summary: blockdev --getsize does not work properly on devices with more than 2^31 sectors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-03 20:40 UTC by Daphne Shaw
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-02 12:17:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daphne Shaw 2007-05-03 20:40:50 UTC
Description of problem:

Given a device with more than 2147483648 sectors (i.e. 2^31), blockdev --getsize
prints the size as a negative number.

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

util-linux-2.13-0.46.fc6

How reproducible:

Steps to Reproduce:
1. Find a device that is bigger than 1TB (or stitch one together via dmsetup)
2. blockdev --getsize /the/device
  
Actual results:

A negative number

Expected results:

A positive number

Additional info:

The BLKGETSIZE ioctl returns a 32-bit unsigned value, but the blockdev program
is using a signed integer, so any value over 2^31 flips negative.

Comment 1 Karel Zak 2007-05-29 07:47:36 UTC
Uff.. the blockdev is really blind. Thanks for your report.

Comment 2 Fedora Update System 2007-08-09 16:49:26 UTC
util-linux-2.13-0.54.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2007-08-24 05:45:55 UTC
util-linux-2.13-0.54.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.


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