Bug 842019 - multiple raid options shouldn't be allowed (-i + -m) with types raid[1|4|5|6]
Summary: multiple raid options shouldn't be allowed (-i + -m) with types raid[1|4|5|6]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-20 21:48 UTC by Corey Marthaler
Modified: 2013-02-21 08:11 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.98-1.el6
Doc Type: Bug Fix
Doc Text:
Previously, it was possible to specify incorrect arguments when creating a RAID logical volume and have them adversely affect the created device. For example, the number of mirrors could be specified for a "raid4" logical volume and the number of devices created would be a multiple of what was specified. These inappropriate arguments are no longer allowed.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:11:43 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

Description Corey Marthaler 2012-07-20 21:48:48 UTC
Description of problem:
This was mentioned in bug 834031 but is really a different issue then what's described in bug 834031.

When -i and -m are used together, the create attempt should fail, not add those two numbers.


# RAID 4 (-m + -i)
[root@taft-01 ~]# lvcreate --type raid4 -m 1 -i 3 -n wrong_options -L 500M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding size (125 extents) up to stripe boundary size (126 extents)
  Logical volume "wrong_options" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                        Attr     LSize   Devices
  wrong_options             rwi-a-r- 504.00m wrong_options_rimage_0(0),wrong_options_rimage_1(0),wrong_options_rimage_2(0),wrong_options_rimage_3(0),wrong_options_rimage_4(0),wrong_options_rimage_5(0),wrong_options_rimage_6(0)
  [wrong_options_rimage_0]  Iwi-aor- 168.00m /dev/sdh2(1)
  [wrong_options_rimage_1]  Iwi-aor- 168.00m /dev/sdh1(1)
  [wrong_options_rimage_2]  Iwi-aor- 168.00m /dev/sdg2(1)
  [wrong_options_rimage_3]  Iwi-aor- 168.00m /dev/sdg1(1)
  [wrong_options_rimage_4]  Iwi-aor- 168.00m /dev/sdf2(1)
  [wrong_options_rimage_5]  Iwi-aor- 168.00m /dev/sdf1(1)
  [wrong_options_rimage_6]  Iwi-aor- 168.00m /dev/sde2(1)
  [wrong_options_rmeta_0]   ewi-aor-   4.00m /dev/sdh2(0)
  [wrong_options_rmeta_1]   ewi-aor-   4.00m /dev/sdh1(0)
  [wrong_options_rmeta_2]   ewi-aor-   4.00m /dev/sdg2(0)
  [wrong_options_rmeta_3]   ewi-aor-   4.00m /dev/sdg1(0)
  [wrong_options_rmeta_4]   ewi-aor-   4.00m /dev/sdf2(0)
  [wrong_options_rmeta_5]   ewi-aor-   4.00m /dev/sdf1(0)
  [wrong_options_rmeta_6]   ewi-aor-   4.00m /dev/sde2(0)

# RAID 5 (-m + -i)
[root@taft-01 ~]# lvcreate --type raid5 -m 1 -i 3 -n wrong_options -L 500M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding size (125 extents) up to stripe boundary size (126 extents)
  Logical volume "wrong_options" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                        Attr     LSize   Devices
  wrong_options             rwi-a-r- 504.00m wrong_options_rimage_0(0),wrong_options_rimage_1(0),wrong_options_rimage_2(0),wrong_options_rimage_3(0),wrong_options_rimage_4(0),wrong_options_rimage_5(0),wrong_options_rimage_6(0)
  [wrong_options_rimage_0]  iwi-aor- 168.00m /dev/sdh2(1)
  [wrong_options_rimage_1]  iwi-aor- 168.00m /dev/sdh1(1)
  [wrong_options_rimage_2]  iwi-aor- 168.00m /dev/sdg2(1)
  [wrong_options_rimage_3]  iwi-aor- 168.00m /dev/sdg1(1)
  [wrong_options_rimage_4]  iwi-aor- 168.00m /dev/sdf2(1)
  [wrong_options_rimage_5]  iwi-aor- 168.00m /dev/sdf1(1)
  [wrong_options_rimage_6]  iwi-aor- 168.00m /dev/sde2(1)
  [wrong_options_rmeta_0]   ewi-aor-   4.00m /dev/sdh2(0)
  [wrong_options_rmeta_1]   ewi-aor-   4.00m /dev/sdh1(0)
  [wrong_options_rmeta_2]   ewi-aor-   4.00m /dev/sdg2(0)
  [wrong_options_rmeta_3]   ewi-aor-   4.00m /dev/sdg1(0)
  [wrong_options_rmeta_4]   ewi-aor-   4.00m /dev/sdf2(0)
  [wrong_options_rmeta_5]   ewi-aor-   4.00m /dev/sdf1(0)
  [wrong_options_rmeta_6]   ewi-aor-   4.00m /dev/sde2(0)

# RAID 6 (-m + -i)
[root@taft-01 ~]# lvcreate --type raid6 -m 1 -i 3 -n wrong_options -L 500M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding size (125 extents) up to stripe boundary size (126 extents)
  Logical volume "wrong_options" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                        Attr     LSize   Devices
  wrong_options             rwi-a-r- 504.00m wrong_options_rimage_0(0),wrong_options_rimage_1(0),wrong_options_rimage_2(0),wrong_options_rimage_3(0),wrong_options_rimage_4(0),wrong_options_rimage_5(0),wrong_options_rimage_6(0),wrong_options_rimage_7(0)
  [wrong_options_rimage_0]  Iwi-aor- 168.00m /dev/sdh2(1)
  [wrong_options_rimage_1]  Iwi-aor- 168.00m /dev/sdh1(1)
  [wrong_options_rimage_2]  Iwi-aor- 168.00m /dev/sdg2(1)
  [wrong_options_rimage_3]  Iwi-aor- 168.00m /dev/sdg1(1)
  [wrong_options_rimage_4]  Iwi-aor- 168.00m /dev/sdf2(1)
  [wrong_options_rimage_5]  Iwi-aor- 168.00m /dev/sdf1(1)
  [wrong_options_rimage_6]  Iwi-aor- 168.00m /dev/sde2(1)
  [wrong_options_rimage_7]  Iwi-aor- 168.00m /dev/sde1(1)
  [wrong_options_rmeta_0]   ewi-aor-   4.00m /dev/sdh2(0)
  [wrong_options_rmeta_1]   ewi-aor-   4.00m /dev/sdh1(0)
  [wrong_options_rmeta_2]   ewi-aor-   4.00m /dev/sdg2(0)
  [wrong_options_rmeta_3]   ewi-aor-   4.00m /dev/sdg1(0)
  [wrong_options_rmeta_4]   ewi-aor-   4.00m /dev/sdf2(0)
  [wrong_options_rmeta_5]   ewi-aor-   4.00m /dev/sdf1(0)
  [wrong_options_rmeta_6]   ewi-aor-   4.00m /dev/sde2(0)
  [wrong_options_rmeta_7]   ewi-aor-   4.00m /dev/sde1(0)


Version-Release number of selected component (if applicable):
2.6.32-279.el6.x86_64

lvm2-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-libs-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-cluster-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
cmirror-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012

Comment 1 Alasdair Kergon 2012-07-20 22:00:54 UTC
Well I think before we make any further piecemeal changes we should attempt to specify a complete list of accepted combinations and precisely what they each mean.  Then make sure the man page and code match this specification.

Before md raid came along, -m and -i together had a clear meaning - to apply mirroring over striping.  But with these newer raid modes, -i takes on a different meaning.

Comment 2 Jonathan Earl Brassow 2012-09-04 21:57:54 UTC
commit de3b1c4506ff502f00a360a83800f35a31e1b42e
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Wed Aug 8 12:32:27 2012 -0500

    RAID: Improve RAID argument handling.
    
    Disallow '-m' for RAID types that have no mirror component and disallow
    '-i' argument for RAID types that have no stripe component.

Comment 3 Jonathan Earl Brassow 2012-09-04 21:58:23 UTC
Unit testing:

[root@hayes-01 ~]# lvcreate -m 1 -i 2 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Logical volume "lv" created
[root@hayes-01 ~]# devices vg
  LV            Copy%  Devices                                    
  lv             94.00 lv_mimage_0(0),lv_mimage_1(0)              
  [lv_mimage_0]        /dev/etherd/e1.1p1(0),/dev/etherd/e1.1p2(0)
  [lv_mimage_1]        /dev/etherd/e1.1p3(0),/dev/etherd/e1.1p4(0)
  [lv_mlog]            /dev/etherd/e1.1p8(0)                      
[root@hayes-01 ~]# !lvr
lvremove -ff vg
  Logical volume "lv" successfully removed
[root@hayes-01 ~]# lvcreate --type raid1 -m 1 -i 2 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Stripe argument cannot be used with segment type, raid1
  Run `lvcreate --help' for more information.
[root@hayes-01 ~]# lvcreate --type raid5 -m 1 -i 2 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Mirror argument cannot be used with segment type, raid5
  Run `lvcreate --help' for more information.
[root@hayes-01 ~]# lvcreate --type raid4 -m 1 -i 2 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Mirror argument cannot be used with segment type, raid4
  Run `lvcreate --help' for more information.
[root@hayes-01 ~]# lvcreate --type raid6 -m 1 -i 2 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Number of stripes must be at least 3 for raid6
  Run `lvcreate --help' for more information.
[root@hayes-01 ~]# lvcreate --type raid6 -m 1 -i 3 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Mirror argument cannot be used with segment type, raid6
  Run `lvcreate --help' for more information.
[root@hayes-01 ~]# lvcreate --type raid10 -m 1 -i 3 -L 200M -n lv vg
  Using default stripesize 64.00 KiB
  Rounding size (50 extents) up to stripe boundary size (51 extents)
  Logical volume "lv" created
[root@hayes-01 ~]# devices vg
  LV            Copy%  Devices                                                                                  
  lv            100.00 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0),lv_rimage_3(0),lv_rimage_4(0),lv_rimage_5(0)
  [lv_rimage_0]        /dev/etherd/e1.1p1(1)                                                                    
  [lv_rimage_1]        /dev/etherd/e1.1p2(1)                                                                    
  [lv_rimage_2]        /dev/etherd/e1.1p3(1)                                                                    
  [lv_rimage_3]        /dev/etherd/e1.1p4(1)                                                                    
  [lv_rimage_4]        /dev/etherd/e1.1p5(1)                                                                    
  [lv_rimage_5]        /dev/etherd/e1.1p6(1)                                                                    
  [lv_rmeta_0]         /dev/etherd/e1.1p1(0)                                                                    
  [lv_rmeta_1]         /dev/etherd/e1.1p2(0)                                                                    
  [lv_rmeta_2]         /dev/etherd/e1.1p3(0)                                                                    
  [lv_rmeta_3]         /dev/etherd/e1.1p4(0)                                                                    
  [lv_rmeta_4]         /dev/etherd/e1.1p5(0)                                                                    
  [lv_rmeta_5]         /dev/etherd/e1.1p6(0)

Comment 5 Corey Marthaler 2012-11-15 21:59:49 UTC
Fix verified in the latest rpms.

2.6.32-339.el6.x86_64
lvm2-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
lvm2-libs-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
lvm2-cluster-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
udev-147-2.43.el6    BUILT: Thu Oct 11 05:59:38 CDT 2012
device-mapper-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-libs-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-event-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-event-libs-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
cmirror-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012

Comment 6 errata-xmlrpc 2013-02-21 08:11:43 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.

http://rhn.redhat.com/errata/RHBA-2013-0501.html


Note You need to log in before you can comment on or make changes to this bug.