Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1906541

Summary: cache activation with cachevol is missing cache_check
Product: Red Hat Enterprise Linux 8 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: urgent CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, zkabelac
Version: 8.3Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.11-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:02: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:

Description David Teigland 2020-12-10 18:30:52 UTC
Description of problem:

Reported https://www.redhat.com/archives/linux-lvm/2020-December/msg00002.html

If dm-cache has set needs_check in the cache metadata, then lvm needs to run cache_check to clear that flag before it can activate.  The cachevol activation code was skipping the cache_check command, so needs_check wouldn't be cleared and the LV couldn't be activated.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 David Teigland 2021-01-11 17:41:31 UTC
I talked with Hank about testing this, and he said that there's no practical way for us to cause the needs_check flag to be set on a cache.  So, I think for testing this we'll just need to observe that the cache_check command is being run, and not require that it's actually clearing the flag.  As for verifying that the cache_check command is run, it's hidden pretty well (which is why I failed to notice it was missing originally), so there's no simple way to observe that either.  It may be simpler to verify that activation is running cache_check by actually removing the cache_check command and verifying that the command warns that it can't run it:

# mv /usr/sbin/cache_check /root/.
# lvchange -ay test/main
  /usr/sbin/cache_check: execvp failed: No such file or directory
  WARNING: Check is skipped, please install recommended missing binary /usr/sbin/cache_check!

Comment 4 Corey Marthaler 2021-01-28 23:27:12 UTC
I assume this will be added to the errata in the next build?

[root@host-084 ~]# lvs -a -o +devices
  LV                    VG            Attr       LSize   Pool         Origin                Data%  Meta%  Move Log Cpy%Sync Convert Devices               
  display_cache         cache_sanity  Cwi-a-C---   4.00g [pool_cpool] [display_cache_corig] 0.00   4.39            0.00             display_cache_corig(0)
  [display_cache_corig] cache_sanity  owi-aoC---   4.00g                                                                            /dev/sda(0)           
  [lvol0_pmspare]       cache_sanity  ewi-------  12.00m                                                                            /dev/sda(1024)        
  [pool_cpool]          cache_sanity  Cwi---C---   4.00g                                    0.00   4.39            0.00             pool_cpool_cdata(0)   
  [pool_cpool_cdata]    cache_sanity  Cwi-ao----   4.00g                                                                            /dev/sdb(0)           
  [pool_cpool_cmeta]    cache_sanity  ewi-ao----  12.00m                                                                            /dev/sdb(1024)        

[root@host-084 ~]# lvchange -an cache_sanity/display_cache
  /usr/sbin/cache_check: execvp failed: No such file or directory
  WARNING: Check is skipped, please install recommended missing binary /usr/sbin/cache_check!


kernel-4.18.0-277.el8    BUILT: Wed Jan 20 09:06:28 CST 2021
lvm2-2.03.11-1.el8    BUILT: Fri Jan  8 05:21:07 CST 2021
lvm2-libs-2.03.11-1.el8    BUILT: Fri Jan  8 05:21:07 CST 2021

Comment 8 Corey Marthaler 2021-02-15 20:17:15 UTC
Final verification with the latest rpms.

kernel-4.18.0-283.el8    BUILT: Thu Feb  4 05:30:59 CST 2021

lvm2-2.03.11-4.el8    BUILT: Thu Feb 11 04:35:23 CST 2021
lvm2-libs-2.03.11-4.el8    BUILT: Thu Feb 11 04:35:23 CST 2021

[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV                    VG           Attr       LSize  Pool         Origin                Data%  Meta%  Move Log Cpy%Sync Convert Devices                Type      
  display_cache         cache_sanity Cwi-a-C---  4.00g [pool_cpool] [display_cache_corig] 0.00   4.52            0.00             display_cache_corig(0) cache     
  [display_cache_corig] cache_sanity owi-aoC---  4.00g                                                                            /dev/sdd(0)            linear    
  [lvol0_pmspare]       cache_sanity ewi------- 12.00m                                                                            /dev/sdc(0)            linear    
  [pool_cpool]          cache_sanity Cwi---C---  4.00g                                    0.00   4.52            0.00             pool_cpool_cdata(0)    cache-pool
  [pool_cpool_cdata]    cache_sanity Cwi-ao----  4.00g                                                                            /dev/sdi(0)            linear    
  [pool_cpool_cmeta]    cache_sanity ewi-ao---- 12.00m                                                                            /dev/sdi(1024)         linear
    
[root@hayes-01 ~]# lvchange -an cache_sanity/display_cache
  /usr/sbin/cache_check: execvp failed: No such file or directory
  WARNING: Check is skipped, please install recommended missing binary /usr/sbin/cache_check!

[root@hayes-01 ~]# lvchange -ay cache_sanity/display_cache
  /usr/sbin/cache_check: execvp failed: No such file or directory
  WARNING: Check is skipped, please install recommended missing binary /usr/sbin/cache_check!

Comment 10 errata-xmlrpc 2021-05-18 15:02:04 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 (lvm2 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1659