Bug 1247386 - lvcreate and lvchange need '--cachepolicy' validity checks
lvcreate and lvchange need '--cachepolicy' validity checks
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Zdenek Kabelac
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-27 17:00 EDT by Corey Marthaler
Modified: 2017-07-12 17:32 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Marthaler 2015-07-27 17:00:30 EDT
Description of problem:
[root@host-109 ~]# lvcreate --cachepolicy smq --type cache-pool -L 2G -n pool1 vg
  Logical volume "pool1" created.
[root@host-109 ~]# lvcreate --cachepolicy cleaner --type cache-pool -L 2G -n pool2 vg
  Logical volume "pool2" created.
[root@host-109 ~]# lvcreate --cachepolicy garbage --type cache-pool -L 2G -n pool3 vg
  Logical volume "pool3" created.
[root@host-109 ~]# lvcreate --cachepolicy fake --type cache-pool -L 2G -n pool4 vg
  Logical volume "pool4" created.

[root@host-109 ~]# lvs -a -o +devices
  LV              VG  Attr       LSize    Devices        
  [lvol0_pmspare] vg  ewi-------   8.00m  /dev/sda1(0)   
  pool1           vg  Cwi---C---   2.00g  pool1_cdata(0) 
  [pool1_cdata]   vg  Cwi-------   2.00g  /dev/sda1(4)   
  [pool1_cmeta]   vg  ewi-------   8.00m  /dev/sda1(2)   
  pool2           vg  Cwi---C---   2.00g  pool2_cdata(0) 
  [pool2_cdata]   vg  Cwi-------   2.00g  /dev/sda1(518) 
  [pool2_cmeta]   vg  ewi-------   8.00m  /dev/sda1(516) 
  pool3           vg  Cwi---C---   2.00g  pool3_cdata(0) 
  [pool3_cdata]   vg  Cwi-------   2.00g  /dev/sda1(1032)
  [pool3_cmeta]   vg  ewi-------   8.00m  /dev/sda1(1030)
  pool4           vg  Cwi---C---   2.00g  pool4_cdata(0) 
  [pool4_cdata]   vg  Cwi-------   2.00g  /dev/sda1(1546)
  [pool4_cmeta]   vg  ewi-------   8.00m  /dev/sda1(1544)

# change the pool to be used in the convert to a fake policy
[root@host-109 ~]# lvchange --cachepolicy fake vg/pool1
  Logical volume "pool1" changed.
[root@host-109 ~]# lvcreate -L 200M -n origin1 vg
  Logical volume "origin1" created.
[root@host-109 ~]# lvconvert --yes --type cache --cachepool vg/pool1 vg/origin1
  device-mapper: reload ioctl on (253:2) failed: Invalid argument
  Failed to lock logical volume vg/origin1.


[root@host-109 ~]# lvcreate --cachepolicy smq --type cache-pool -L 2G -n pool5 vg
  Logical volume "pool5" created.
[root@host-109 ~]# lvcreate -L 200M -n origin2 vg
  Logical volume "origin2" created.
[root@host-109 ~]# lvconvert --yes --type cache --cachepool vg/pool5 vg/origin2
  Logical volume vg/origin2 is now cached.

# attempt to change the policy of an existing valid one
[root@host-109 ~]# lvchange --cachepolicy fake vg/origin2
  device-mapper: reload ioctl on (253:2) failed: Invalid argument
  Failed to lock logical volume vg/origin2.

[ 1732.044604] device-mapper: cache-policy: unknown policy type
[ 1732.045245] device-mapper: table: 253:2: cache: Error creating cache's policy
[ 1732.046035] device-mapper: ioctl: error adding target to table



Version-Release number of selected component (if applicable):
3.10.0-296.el7.x86_64
lvm2-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-libs-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-cluster-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-persistent-data-0.5.4-1.el7    BUILT: Fri Jul 17 08:56:22 CDT 2015
cmirror-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
Comment 1 Zdenek Kabelac 2015-08-24 04:25:58 EDT
We could try better here - however the idea behind cache policies is to let user create his own policy module - so lvm2 allows arbitrary policy name - not just 'mq' or 'smq'

But we may possibly hook some extra module test for policy name - I'll check with Joe what are the limits for policy names.

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