| Summary: | dmsetup does not reflect the changed cache mode when moving from writethrough -> writeback | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> | ||||
| Component: | lvm2 | Assignee: | Zdenek Kabelac <zkabelac> | ||||
| lvm2 sub component: | Changing Logical Volumes | QA Contact: | cluster-qe <cluster-qe> | ||||
| Status: | CLOSED NOTABUG | Docs Contact: | |||||
| Severity: | low | ||||||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac | ||||
| Version: | 7.3 | ||||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2017-01-22 20:17:40 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: | |||||
| Attachments: |
|
||||||
|
Description
Corey Marthaler
2016-10-10 15:07:52 UTC
Created attachment 1208891 [details]
verbose lvchange attempt
writeback -> writethrough appears to work fine. [root@host-126 ~]# lvcreate -L 4G -n corigin test Logical volume "corigin" created. [root@host-126 ~]# lvcreate --yes --type cache-pool --cachepolicy mq --cachemode writeback -L 500M test/cpool Using default stripesize 64.00 KiB. Logical volume "cpool" created. [root@host-126 ~]# lvconvert --yes --type cache --cachepool test/cpool test/corigin Logical volume test/corigin is now cached. [root@host-126 ~]# lvs -a -o +devices,cachemode,cachepolicy LV VG Attr LSize Pool Origin Data% Meta% Cpy%Sync Devices CacheMode CachePolicy corigin test Cwi-a-C--- 4.00g [cpool] [corigin_corig] 0.00 1.07 0.00 corigin_corig(0) writeback mq [corigin_corig] test owi-aoC--- 4.00g /dev/sda1(0) [cpool] test Cwi---C--- 500.00m 0.00 1.07 0.00 cpool_cdata(0) writeback mq [cpool_cdata] test Cwi-ao---- 500.00m /dev/sda1(1028) [cpool_cmeta] test ewi-ao---- 8.00m /dev/sda1(1026) [lvol0_pmspare] test ewi------- 8.00m /dev/sda1(1024) [root@host-126 ~]# dmsetup table test-cpool_cdata: 0 1024000 linear 8:1 8423424 test-cpool_cmeta: 0 16384 linear 8:1 8407040 test-corigin_corig: 0 8388608 linear 8:1 2048 test-corigin: 0 8388608 cache 253:4 253:3 253:5 128 1 writeback mq 0 [root@host-126 ~]# lvchange --cachepolicy cleaner --cachemode writethrough test/corigin Flushing 1 blocks for cache test/corigin. Logical volume test/corigin changed. [root@host-126 ~]# lvs -a -o +devices,cachemode,cachepolicy LV VG Attr LSize Pool Origin Data% Meta% Cpy%Sync Devices CacheMode CachePolicy corigin test Cwi-a-C--- 4.00g [cpool] [corigin_corig] 0.00 1.56 0.00 corigin_corig(0) writethrough cleaner [corigin_corig] test owi-aoC--- 4.00g /dev/sda1(0) [cpool] test Cwi---C--- 500.00m 0.00 1.56 0.00 cpool_cdata(0) writethrough cleaner [cpool_cdata] test Cwi-ao---- 500.00m /dev/sda1(1028) [cpool_cmeta] test ewi-ao---- 8.00m /dev/sda1(1026) [lvol0_pmspare] test ewi------- 8.00m /dev/sda1(1024) [root@host-126 ~]# dmsetup table test-cpool_cdata: 0 1024000 linear 8:1 8423424 test-cpool_cmeta: 0 16384 linear 8:1 8407040 test-corigin_corig: 0 8388608 linear 8:1 2048 test-corigin: 0 8388608 cache 253:4 253:3 253:5 128 1 writethrough cleaner 0 Yep - this is intended logic - 'cleaner' policy requires 'writethrough' cache mode to be used. It doesn't work in writeback and may eventually cause endless clearing loop. Once the 'cleaner' policy is switched to 'smq/mq' it goes to the right cache mode. If this is not documented somewhere - like it's RFE for man page enhancement. The command code works properly and does the right thing. |