Bug 1221571

Summary: aarch64: md-create fails to create Linux md (RAID) device
Product: Red Hat Enterprise Linux 7 Reporter: Hu Zhang <huzhan>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 7.1CC: leiwang, linl, ptoscano, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-23 15:21:57 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 Hu Zhang 2015-05-14 11:42:18 UTC
Description of problem:
"md-create" fails to create Linux md (RAID) device. This works well on rhel7.1-x86_64.


Version-Release number of selected component (if applicable):
libguestfs-1.28.1-1.23.aa7a.aarch64
kernel-3.19.0-0.75.aa7a.aarch64

How reproducible:
Always

Steps to Reproduce:
1. Create three images.
# qemu-img create -f raw gs-md1.img 5G
Formatting 'gs-md1.img', fmt=raw size=5368709120
# qemu-img create -f raw gs-md2.img 5G
Formatting 'gs-md2.img', fmt=raw size=5368709120
# qemu-img create -f raw gs-md3.img 5G
Formatting 'gs-md3.img', fmt=raw size=5368709120

2. # guestfish
><fs> add gs-md1.img
><fs> add gs-md2.img                                                                                      
><fs> add gs-md3.img                                                                                      
><fs> run                                                                                                
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00

3. create Linux md (RAID) device
><fs> md-create md11 "/dev/sda /dev/sdb /dev/sdc" missingbitmap:0x4 chunk:8192 level:raid6                
libguestfs: error: md_create: mdadm: md11: mdadm: Defaulting to version 1.2 metadata                      
mdadm: RUN_ARRAY failed: Invalid argument                                                                    

Actual results:
Described as step.3.

Expected results:
"md-create" can create Linux md (RAID) device successfully and can get the md info like below.                    
><fs> list-md-devices                                                                                    
/dev/md127

Additional info:

Comment 2 Richard W.M. Jones 2015-05-15 15:33:32 UTC
One line reproducer:

guestfish -N disk:5G -N disk:5G -N disk:5G \
  md-create md11 "/dev/sda /dev/sdb /dev/sdc" missingbitmap:0x4 chunk:8192 level:raid6

The error is reproducible on Rawhide/aarch64 too.

I believe this is caused by the larger page size on aarch64.  Page
size on aarch64 is 64K, whereas on x86 it is 4K.

If you increase the chunk: parameter to 65536, then the error
goes away.  ie This command works fine (on Rawhide/aarch64):

guestfish -N disk:5G -N disk:5G -N disk:5G \
  md-create md11 "/dev/sda /dev/sdb /dev/sdc" missingbitmap:0x4 chunk:65536 level:raid6

So this is either NOTABUG or a bug in mdadm depending on your
viewpoint.

Comment 3 Richard W.M. Jones 2015-09-23 15:21:57 UTC
Closing NOTABUG per comment 2.  It's a limitation of mdadm when
used with a large (64K) page size as found on aarch64.