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.

Bug 1209445

Summary: When creating a RAID4/5/6 with wrongly formatted options, the creation succeeds.
Product: Red Hat Enterprise Linux 6 Reporter: Nenad Peric <nperic>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 6.7   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.118-2.el6 Doc Type: Bug Fix
Doc Text:
Cause: Missing check for correct combination of options used when creating RAID4/5/6 LVs. Consequence: lvcreate allowed -m/--mirror option to be specified while creating RAID4/5/6 LVs. This may led users to incorrect assumptions that -m/--mirror option is somehow used, but it was ignored. Fix: A check has been added which prevents incorrect combination with -m/--mirror option to be used while creating RAID4/5/6 LVs. Result: -m/--mirror option is not allowed when creating RAID4/5/6 LVs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:38:33 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 Nenad Peric 2015-04-07 11:30:58 UTC
Description of problem:

Creating a RAID4 with wrongly formatted options suplpied, the creation succeeds and the resulting LV is perhaps not what it was "expected".

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

lvm2-2.02.118-1.el6.x86_64

How reproducible:

Everytime

Steps to Reproduce:
Create VG
Create LV wit wrong options:
 lvcreate  --type raid4 -m 2 -i 3 -n wrong_options -L 500M raid_sanity

Actual results:

This is created (9+1 LVs):
[root@tardis-02 ~]# lvs -a
  LV                       VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  wrong_options            raid_sanity rwi-a-r--- 504.00m                                    100.00          
  [wrong_options_rimage_0] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_1] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_2] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_3] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_4] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_5] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_6] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_7] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_8] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rimage_9] raid_sanity iwi-aor---  56.00m                                                    
  [wrong_options_rmeta_0]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_1]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_2]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_3]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_4]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_5]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_6]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_7]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_8]  raid_sanity ewi-aor---   4.00m                                                    
  [wrong_options_rmeta_9]  raid_sanity ewi-aor---   4.00m                             


Expected results:

Perhaps the creation should not be allowed with options which don't go well together with raid.

Comment 2 Heinz Mauelshagen 2015-04-07 11:47:21 UTC
LVM command line option and option argument processing as it stands will factor "-m 2" causing 3 legs times "-i 3" for 3 stripes resulting in 9 data images and add another image for the dedicated raid4 parity disk resulting in a grand total of 10 image component pairs  as reported by "lvs -a ...".

The same applies to mappings "raid5" and "raid6".

We'd need a check for raid4/5/6 similar to the one we already have for "mirror", "raid1" and "striped" to avoid "-m #" being applied altogether.

Comment 4 Corey Marthaler 2015-04-07 18:53:28 UTC
Looks like this is the rhel6.7 version of bug 1194464.

Comment 6 Corey Marthaler 2015-04-29 16:20:44 UTC
Fix verified in the latest rpms.

2.6.32-554.el6.x86_64
lvm2-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-libs-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-cluster-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
udev-147-2.61.el6    BUILT: Mon Mar  2 05:08:11 CST 2015
device-mapper-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-libs-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-libs-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015


# RAID1
[root@host-078 ~]# lvcreate --type raid1 -m 2 -i 3 -n wrong_options -L 500M VG
  Using default stripesize 64.00 KiB.
  Stripe argument cannot be used with segment type, raid1
  Run `lvcreate --help' for more information.

# RAID4
[root@host-078 ~]# lvcreate --type raid4 -m 2 -i 3 -n wrong_options -L 500M VG
  Using default stripesize 64.00 KiB.
  Mirror argument cannot be used with segment type, raid4
  Run `lvcreate --help' for more information.

# RAID5
[root@host-078 ~]# lvcreate --type raid5 -m 2 -i 3 -n wrong_options -L 500M VG
  Using default stripesize 64.00 KiB.
  Mirror argument cannot be used with segment type, raid5
  Run `lvcreate --help' for more information.

# RAID6
[root@host-078 ~]# lvcreate --type raid6 -m 2 -i 3 -n wrong_options -L 500M VG
  Using default stripesize 64.00 KiB.
  Mirror argument cannot be used with segment type, raid6
  Run `lvcreate --help' for more information.

Comment 7 errata-xmlrpc 2015-07-22 07:38:33 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, 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://rhn.redhat.com/errata/RHBA-2015-1411.html