Bug 2064176

Summary: gdisk naming partitions doesn't work for big endian systems
Product: Red Hat Enterprise Linux 8 Reporter: Martin Kyral <mkyral>
Component: gdiskAssignee: Nikola Forró <nforro>
Status: CLOSED DUPLICATE QA Contact: Martin Kyral <mkyral>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.6Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-18 10:10:39 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 Martin Kyral 2022-03-15 08:36:59 UTC
Description of problem:

On s390x systems, when we print partition names in gdisk, they are broken:


[root@s390x-kvm-039 ~]# gdisk -l /tmp/tmp.ydqTCA2yF4
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /tmp/tmp.ydqTCA2yF4: 131072 sectors, 64.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): DFB1F964-24E7-412D-9A25-7837EB2D29A5
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 131038
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          131038   63.0 MiB    8300  䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀
[root@s390x-kvm-039 ~]# 


while it should be like:

[root@ibm-z-532 ~]# gdisk -l /tmp/tmp.trTgCQifmd
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /tmp/tmp.trTgCQifmd: 131072 sectors, 64.0 MiB
Sector size (logical): 512 bytes
Disk identifier (GUID): F067F1C3-740C-4D38-839A-42872727BA64
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 131038
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          131038   63.0 MiB    8300  Linux filesystem
[root@ibm-z-532 ~]# 

it seems the bytes order is reversed. The issue has been apparently introduced by fix for BZ#1899990.


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

gdisk-1.0.3-8.el8


How reproducible:
Always


Steps to Reproduce:
1. run the /usr/share/doc/gdisk/gdisk_test.sh script. Make sure it runs on installed gdisk
2.
3.

Actual results:
Fails in the second step:

**FAILED** Create new partition


Expected results:

All pass


Additional info: