Bug 1113770

Summary: need a more graceful way to fail when attempting to cache RO devices
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Cache Logical Volumes (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, rbednar, salmy, zkabelac
Version: 6.6   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1110965 Environment:
Last Closed: 2016-10-13 21:34:04 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:
Bug Depends On: 1899148, 1110965    
Bug Blocks:    

Comment 1 Corey Marthaler 2014-06-26 21:47:02 UTC
Not exactly they same as in rhel7.

[root@host-001 ~]# lvcreate -p r -L 4G -n corigin cache_sanity /dev/sdb1
  WARNING: "cache_sanity/corigin" not zeroed
  Logical volume "corigin" created
[root@host-001 ~]# lvcreate -p r -L 2G -n display_cache cache_sanity /dev/sde1
  WARNING: "cache_sanity/display_cache" not zeroed
  Logical volume "display_cache" created
[root@host-001 ~]# lvcreate -p r -L 8M -n display_cache_meta cache_sanity /dev/sde1
  WARNING: "cache_sanity/display_cache_meta" not zeroed
  Logical volume "display_cache_meta" created
[root@host-001 ~]# lvs -a -o +devices
  LV                 VG           Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  corigin            cache_sanity -ri-a-----   4.00g                                                     /dev/sdb1(0)   
  display_cache      cache_sanity -ri-a-----   2.00g                                                     /dev/sde1(0)   
  display_cache_meta cache_sanity -ri-a-----   8.00m                                                     /dev/sde1(512) 
  lv_root            vg_host001   -wi-ao----   6.71g                                                     /dev/vda2(0)   
  lv_swap            vg_host001   -wi-ao---- 816.00m                                                     /dev/vda2(1718)

[root@host-001 ~]# lvconvert --type cache-pool --cachemode writeback --poolmetadata cache_sanity/display_cache_meta cache_sanity/display_cache
  WARNING: Converting "cache_sanity/display_cache" logical volume to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert "cache_sanity/display_cache"? [y/n]: y
  WARNING: Converting "cache_sanity/display_cache_meta" logical volume to pool's metadata volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert "cache_sanity/display_cache_meta"? [y/n]: y
  /dev/cache_sanity/display_cache_meta: write failed after 0 of 4096 at 0: Operation not permitted
  Logical volume "lvol0" created
  Converted "cache_sanity/display_cache" to cache pool.

[root@host-001 ~]# lvconvert --type cache --cachepool cache_sanity/display_cache cache_sanity/corigin
  cache_sanity/corigin is now cached.


2.6.32-485.el6.x86_64

lvm2-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
lvm2-libs-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
lvm2-cluster-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
udev-147-2.55.el6    BUILT: Wed Jun 18 06:30:21 CDT 2014
device-mapper-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-libs-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-event-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-event-libs-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014

Comment 2 Marian Csontos 2014-08-27 12:29:32 UTC
Still an issue with upstream LVM2.

Comment 3 Jonathan Earl Brassow 2014-08-27 12:41:03 UTC
cache origin can be read-only, but cache [meta]data LV should not be allowed to be read-only.  Please add the necessary checks.

Comment 9 Roman Bednář 2016-09-02 09:30:25 UTC
Adding QA ack for 6.9.

Comment 10 Jonathan Earl Brassow 2016-10-13 21:34:04 UTC
Closing this WONTFIX.  It is a nuisance fix better left to upstream/rhel7.