Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description:
mdadm allows to create RAID array using duplicated disks:
mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R
It should be forbidden.
Commands trace:
# mdadm -C /dev/md/imsm0 -amd -e imsm -n 6 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg
# cat /proc/mdstat
Personalities : [raid1]
md127 : inactive sdg[5](S) sdf[4](S) sde[3](S) sdd[2](S) sdc[1](S) sdb[0](S)
1254 blocks super external:imsm
unused devices: <none>
# mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R
mdadm: /dev/sdb appears to be part of a raid array:
level=container devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: /dev/sdb appears to be part of a raid array:
level=container devices=0 ctime=Wed Dec 31 19:00:00 1969
mdadm: Creating array inside imsm container /dev/md/imsm0
mdadm: ADD_NEW_DISK for /dev/sdb failed: File exists
# cat /proc/mdstat
Personalities : [raid1]
md126 : inactive sdb[0]
244196224 blocks super external:/md127/0
md127 : inactive sdg[5](S) sdf[4](S) sde[3](S) sdd[2](S) sdc[1](S) sdb[0](S)
1254 blocks super external:imsm
unused devices: <none>
Steps to reproduce:
1. Boot OS.
2. Create IMSM container.
3. Create RAID0 using duplicated disks passed through the parameter:
mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R
Expected results:
Last operation shall be forbidden. Error message shall appear.
Actual results:
RAID array is created.
Environment Details:
-OS: RH 6.0 Snap 6 (64-bit)
-Chipset: IBX
-CRB: ASUS
-HDDs: WD 250 GB
Comment 2RHEL Program Management
2010-06-23 08:03:08 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
inclusion.
Created attachment 426237[details]
cleanup after failed create in duplicated array member case
mdadm prevents creation when device names are duplicated on the command
line, but leaves the partially created array intact. Detect this case
in the error code from add_to_super() and cleanup the partially created
array. The imsm handler is updated to report this conflict in
add_to_super_imsm_volume().
Note that since neither mdmon, nor userspace for that matter, ever saw an
active array we only need to perform a subset of the cleanup actions.
So call ioctl(STOP_ARRAY) directly and arrange for Create() to cleanup
the map file rather than calling Manage_runstop().
RedHat,
Please include this mdadm's patch in RHEL6.0.
Peter, this issue needs to be added to the mdadm package for RHEL 6.0 release. Please set this bug to the correct owner or status so we can get the fix included into RHEL 6.0. Thanks, EDC
Created attachment 428525[details]
x86_64 mdadm + patch rpm
Intel colleagues,
Attached is an mdadm RPM, based on the latest internal version of mdadm plus the patch you have suggested.
Could you please download and test this RPM?
Thanks,
P.
Created attachment 429768[details]
RHEL6 src rpm + patch
Hi Krystof,
AFAICT, the patch is in the binary rpm I previously provided.
When I do an rpmbuild -bp mdadm.spec I see
Patch #21 (mdadm-test.patch):
+ /bin/cat /root/rpmbuild/SOURCES/mdadm-test.patch
+ /usr/bin/patch -s -p1 -b --suffix .test --fuzz=0
+ exit 0
and visual inspection of the resulting source tree shows that the patch has been applied.
Additionally, the build logs also show that mdadm-test.patch was applied to the tree.
P.
> Hi Krystof,
Oops ... sorry about that Krzysztof. My apologies for spelling your name wrong.
P.
Comment 11Krzysztof Wojcik
2010-07-06 14:36:43 UTC
(In reply to comment #10)
> > Hi Krystof,
>
> Oops ... sorry about that Krzysztof. My apologies for spelling your name
> wrong.
>
> P.
OK :)
I built binary rpm according your src rpm and it works as expected so you may include the patch to next snapshot of the RHEL.
Note:
Please investigate why your binary rpm is different then my and does not include the patch?
Comment 12Krzysztof Wojcik
2010-07-08 13:54:30 UTC
Prarit,
How are things going on?
Are you post the patch to the next snapshot of RHEL6.0
Hi Krzysztof, I'm actually going to be pulling in all the various bug fixes that are upstream via a git update, so this will get pulled in for sure that way.
Description: mdadm allows to create RAID array using duplicated disks: mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R It should be forbidden. Commands trace: # mdadm -C /dev/md/imsm0 -amd -e imsm -n 6 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg # cat /proc/mdstat Personalities : [raid1] md127 : inactive sdg[5](S) sdf[4](S) sde[3](S) sdd[2](S) sdc[1](S) sdb[0](S) 1254 blocks super external:imsm unused devices: <none> # mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R mdadm: /dev/sdb appears to be part of a raid array: level=container devices=0 ctime=Wed Dec 31 19:00:00 1969 mdadm: /dev/sdb appears to be part of a raid array: level=container devices=0 ctime=Wed Dec 31 19:00:00 1969 mdadm: Creating array inside imsm container /dev/md/imsm0 mdadm: ADD_NEW_DISK for /dev/sdb failed: File exists # cat /proc/mdstat Personalities : [raid1] md126 : inactive sdb[0] 244196224 blocks super external:/md127/0 md127 : inactive sdg[5](S) sdf[4](S) sde[3](S) sdd[2](S) sdc[1](S) sdb[0](S) 1254 blocks super external:imsm unused devices: <none> Steps to reproduce: 1. Boot OS. 2. Create IMSM container. 3. Create RAID0 using duplicated disks passed through the parameter: mdadm -C /dev/md/myvolume -amd -l0 --chunk 128 -n 2 /dev/sdb /dev/sdb -R Expected results: Last operation shall be forbidden. Error message shall appear. Actual results: RAID array is created. Environment Details: -OS: RH 6.0 Snap 6 (64-bit) -Chipset: IBX -CRB: ASUS -HDDs: WD 250 GB