Bug 711890 - lvconvert --stripes|--stripesize options appear worthless
Summary: lvconvert --stripes|--stripesize options appear worthless
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2
Version: 5.7
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks: 807971 928849 861227
TreeView+ depends on / blocked
 
Reported: 2011-06-08 21:39 UTC by Corey Marthaler
Modified: 2013-10-01 00:26 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.88-11.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 861227 953250 (view as bug list)
Environment:
Last Closed: 2013-10-01 00:26:45 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1352 normal SHIPPED_LIVE lvm2 bug fix update 2013-09-30 21:12:36 UTC

Description Corey Marthaler 2011-06-08 21:39:57 UTC
Description of problem:

[root@taft-03 ~]# lvcreate -n L -L 100M taft
  Logical volume "L" created
[root@taft-03 ~]# lvcreate -n M -m 1 -L 100M taft
  Logical volume "M" created
[root@taft-03 ~]# lvcreate -n S -i 2 -L 100M taft
  Using default stripesize 64.00 KB
  Rounding size (25 extents) up to stripe boundary size (26 extents)
  Logical volume "S" created

[root@taft-03 ~]# lvs -a -o +devices
  LV           VG    Attr   LSize   Log    Copy%  Devices
  L            taft  -wi-a- 100.00M               /dev/sdb1(0)
  M            taft  mwi-a- 100.00M M_mlog 100.00 M_mimage_0(0),M_mimage_1(0)
  [M_mimage_0] taft  iwi-ao 100.00M               /dev/sdb1(25)
  [M_mimage_1] taft  iwi-ao 100.00M               /dev/sdc1(0)
  [M_mlog]     taft  lwi-ao   4.00M               /dev/sdh1(0)
  S            taft  -wi-a- 104.00M               /dev/sdb1(50),/dev/sdc1(25)

[root@taft-03 ~]# lvconvert --stripes 2 taft/L
  Using default stripesize 64.00 KB

[root@taft-03 ~]# lvconvert --stripes 2 taft/S
  Using default stripesize 64.00 KB

[root@taft-03 ~]# lvs -a -o +devices
  LV           VG    Attr   LSize   Log    Copy%  Devices
  L            taft  -wi-a- 100.00M               /dev/sdb1(0)
  M            taft  mwi-a- 100.00M M_mlog 100.00 M_mimage_0(0),M_mimage_1(0)
  [M_mimage_0] taft  iwi-ao 100.00M               /dev/sdb1(25)
  [M_mimage_1] taft  iwi-ao 100.00M               /dev/sdc1(0)
  [M_mlog]     taft  lwi-ao   4.00M               /dev/sdh1(0)
  S            taft  -wi-a- 104.00M               /dev/sdb1(50),/dev/sdc1(25)

[root@taft-03 ~]# lvconvert --stripes 4 taft/S
  Using default stripesize 64.00 KB
[root@taft-03 ~]# lvs -a -o +devices
  LV           VG    Attr   LSize   Log    Copy%  Devices
  L            taft  -wi-a- 100.00M               /dev/sdb1(0)
  M            taft  mwi-a- 100.00M M_mlog 100.00 M_mimage_0(0),M_mimage_1(0)
  [M_mimage_0] taft  iwi-ao 100.00M               /dev/sdb1(25)
  [M_mimage_1] taft  iwi-ao 100.00M               /dev/sdc1(0)
  [M_mlog]     taft  lwi-ao   4.00M               /dev/sdh1(0)
  S            taft  -wi-a- 104.00M               /dev/sdb1(50),/dev/sdc1(25)


Version-Release number of selected component (if applicable):
2.6.18-265.el5

lvm2-2.02.84-4.el5    BUILT: Thu Jun  2 05:04:32 CDT 2011
lvm2-cluster-2.02.84-3.el5    BUILT: Wed Apr 27 03:42:43 CDT 2011
device-mapper-1.02.63-3.el5    BUILT: Thu May 19 08:09:22 CDT 2011
device-mapper-event-1.02.63-3.el5    BUILT: Thu May 19 08:09:22 CDT 2011
cmirror-1.1.39-10.el5    BUILT: Wed Sep  8 16:32:05 CDT 2010
kmod-cmirror-0.1.22-3.el5    BUILT: Tue Dec 22 13:39:47 CST 2009


How reproducible:
Everytime

Comment 1 Alasdair Kergon 2011-11-22 12:57:51 UTC
lvconvert does not change the striping.

--stripes means than any new space allocated will be striped, *if* the command allocates any space.

lvconvert <lvname> sometimes completes an incomplete lvconvert

So we probably want to give an error if --stripes is given without any accompanying conversion instructions.

=> Review all the current lvconvert cmdlines and add error messages as appropriate for combinations that include --stripes and *never* make sense.

Comment 2 Alasdair Kergon 2011-11-22 18:15:01 UTC
The man page states:

      Exactly  one  of  --splitmirrors,  --mirrors,  --repair,  --snapshot or --merge arguments is
       required.

It appears that is not being enforced - you did not specify any of those and did not get an error.

Requires a complete reconciliation between the man page and the code, to make sure the allowed combinations of options are all documented and the code matches the documentation.

Comment 5 RHEL Program Management 2012-04-02 10:35:20 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 8 Peter Rajnoha 2013-04-08 08:57:19 UTC
(comment from RHEL6 bug 861227)

Patch is upstream now (v2.02.99):

http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=cad22be3942809bac979d42195ea5a861a91a71f

It allows the --stripes/--stripesize only with lvconvert --mirrors, --repair and --thinpool where it does make sense, otherwise, you get an error message:

$ lvconvert --merge --stripes 2 vg/lvol0
  --stripes or --stripesize argument is only valid with --mirrors, --repair or --thinpool
  Run `lvconvert --help' for more information.

Man page has been updated accordingly - it's also mentioned that --stripes works for newly allocated space only.

Comment 10 Steven J. Levine 2013-04-17 18:36:59 UTC
I have cloned this as a documentation bug: BZ#953250 to be sure that we cover this in the LVM manual in addition to the man page.

Comment 11 Peter Rajnoha 2013-04-18 07:34:24 UTC
(In reply to comment #8)
> (comment from RHEL6 bug 861227)
> 
> Patch is upstream now (v2.02.99):
> 
> http://git.fedorahosted.org/cgit/lvm2.git/commit/
> ?id=cad22be3942809bac979d42195ea5a861a91a71f

+ https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e8025aa67a05af046878f52dfb45fca30ed70084

(also allow --type with --stripes)

Comment 12 Nenad Peric 2013-05-16 08:35:07 UTC
Maybe I am doing something wrong here, but when I run the command on purpose to cause it to display error it says:

[root@r5-node02:~]$ lvconvert --stripes 2 test/L
  --stripes or --stripesize argument is only valid with --mirrors, --repair or --type

but is --type supported at all by lvconvert?
When I tried using it I got:

lvconvert: unrecognized option `--type'
  Error during parsing of command line.

There is no man page explanation of --type for lvconvert as well. 
Should this option actually be in RHEL5?
If so, man page should reflect which types are supported, how the option is used and when it is expected.

Comment 13 Peter Rajnoha 2013-05-16 08:51:36 UTC
(In reply to comment #12)
> Maybe I am doing something wrong here, but when I run the command on purpose
> to cause it to display error it says:
> 
> [root@r5-node02:~]$ lvconvert --stripes 2 test/L
>   --stripes or --stripesize argument is only valid with --mirrors, --repair
> or --type
> 
> but is --type supported at all by lvconvert?
> When I tried using it I got:
> 
> lvconvert: unrecognized option `--type'
>   Error during parsing of command line.

That's OK. The --type arg has been added for lvconvert later, v88 is just too old. So the --type has no meaning for lvconvert in v88. Sorry, I should have mentioned that... (I automatically added comment #11 for the additional upstream patch, but I did not realize at that moment it's not applicable to v88).

Comment 14 Peter Rajnoha 2013-05-16 09:04:52 UTC
(In reply to comment #12)
> Maybe I am doing something wrong here, but when I run the command on purpose
> to cause it to display error it says:
> 
> [root@r5-node02:~]$ lvconvert --stripes 2 test/L
>   --stripes or --stripesize argument is only valid with --mirrors, --repair
> or --type

(I'll remove the "type" from the error message in the final build)

Comment 16 Nenad Peric 2013-05-21 12:23:32 UTC
The newest build of lvm2-88-11 has the corrected error messages and is enforcing the behavior described in man pages:

[root@r5-node02:~]$ lvconvert --stripes 4  test/S
  --stripes or --stripesize argument is only valid with --mirrors and --repair
  Run `lvconvert --help' for more information.

[root@r5-node02:~]$ lvconvert --stripes 4 test/L
  --stripes or --stripesize argument is only valid with --mirrors and --repair
Run `lvconvert --help' for more information.

Marking verified with 

lvm2-2.02.88-11.el5

Comment 17 errata-xmlrpc 2013-10-01 00:26:45 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-1352.html


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