Bug 2041498

Summary: incorrect partition size calculation for BLKPG_* ioctls
Product: Red Hat Enterprise Linux 8 Reporter: Karel Zak <kzak>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Radka Brychtova <rskvaril>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: rskvaril
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: util-linux-2.32.1-32.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:30:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Zak 2022-01-17 14:12:44 UTC
Description of problem:

libfdisk incorrectly calculates partition size for BLKPG_* ioctls, kernel assumes 512-byte 
sectors, but libfdisk uses real sectors. This problem is already fixed in the upstream tree.

We need to backport commits:

33f50706fd7c1c5e53f8f355f12b685c6935f5a4
libfdisk: fix fdisk_reread_changes() for extended partitions

6a4d53ce6466fc97c0ee13846cd1bf7bdd7bfef0
libfdisk: fix partition calculation for BLKPG_* ioctls

Note that fdisk uses BLKPG_* ioctl only if the device is in use, otherwise it uses BLKRRPART which is not affected by this bug. So, a possible workaround is to keep the device unused (lvm, dm, mount any fs, etc...) when you call fdisk, or reboot your system after the fdisk "w" command.

(References: bug #2016229)

Comment 10 errata-xmlrpc 2022-05-10 15:30:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2100