Bug 1248030 - bad .cache file prevents RHEV host from functioning after reboot
Summary: bad .cache file prevents RHEV host from functioning after reboot
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
Depends On: 1240507
TreeView+ depends on / blocked
Reported: 2015-07-29 13:14 UTC by Jaroslav Reznik
Modified: 2019-08-15 05:00 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.111-2.el6_6.5
Doc Type: Bug Fix
Doc Text:
Prior to this update, using the lvm utility when the persistent cache file was outdated caused devices that were stored in the persistent cache to unintentionally bypass logical volume manager (LVM) filters set in the LVM configuration. As a consequence, Red Hat Enterprise Virtualization hosts in some cases failed to start with an outdated cache file. This update fixes LVM's internal cache handling so that the filters are applied properly, and the described problem no longer occurs.
Clone Of: 1240507
Last Closed: 2015-08-24 07:49:55 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1655 normal SHIPPED_LIVE lvm2 bug fix update 2015-09-11 17:01:45 UTC

Description Jaroslav Reznik 2015-07-29 13:14:41 UTC
This bug has been copied from bug #1240507 and has been proposed
to be backported to 6.6 z-stream (EUS).

Comment 4 Peter Rajnoha 2015-07-30 11:04:33 UTC
I'm attaching complete reproducer here because it's very important to test this properly and avoid confusion by touching .cache file and hence changing timestamps (because timestamp comparison for lvm.conf file and .cache file matters a lot here for rescans and we could test completely different thing then!).

(remove existing .cache file to start with clean state)
# rm -f /etc/lvm/cache/.cache

(make sure filter is not set)
# lvm dumpconfig devices/filter
  Configuration node devices/filter not found

(create a PV on base device)
# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created

(get the PV UUID of just created PV)
# pvs -o name,uuid /dev/sda
  PV         PV UUID                               
  /dev/sda   T55Rb7-CWWS-7tSM-Wnq8-UZQs-4IPe-YMKbhO

# ...edit devices/filter setting in /etc/lvm/lvm.conf to reject all devices...

(make sure filter is set to reject all devices)
# lvm dumpconfig devices/filter

(get size of the base device...)
# blockdev --getsize /dev/sda

(...and use the size to create dm mapping over the whole device - this simulates mpath for example)
# dmsetup create test --table "0 262144 linear /dev/sda 0"

(get the dm-X block device name for the mapping)
# dmsetup info -c -o name,blkdevname test
Name             BlkDevName      
test             dm-2 

(check the lvm-pv-uuid-* symlink points to the dm device we just created)
# ls -l /dev/disk/by-id/lvm-pv-uuid-T55Rb7-CWWS-7tSM-Wnq8-UZQs-4IPe-YMKbhO 
lrwxrwxrwx. 1 root root 10 Jul 30 12:49 /dev/disk/by-id/lvm-pv-uuid-T55Rb7-CWWS-7tSM-Wnq8-UZQs-4IPe-YMKbhO -> ../../dm-2

(call pvs to scan the state as it is now - that is with the dm mapping over the base device)
# pvs

(now remove the mapping)
# dmsetup remove test                        

(check the lvm-pv-uuid-* symlinks now points to the base device)
# ls -l /dev/disk/by-id/lvm-pv-uuid-T55Rb7-CWWS-7tSM-Wnq8-UZQs-4IPe-YMKbhO 
lrwxrwxrwx. 1 root root 9 Jul 30 12:50 /dev/disk/by-id/lvm-pv-uuid-T55Rb7-CWWS-7tSM-Wnq8-UZQs-4IPe-YMKbhO -> ../../sda

(call pvs now - recall that we have filter set to "reject all" and despite that pvs incorrectly displays the base device because it's confused by the outdated persistent cache - the .cache file and the bug we had in the cache handling code)
# pvs                   
  PV         VG   Fmt  Attr PSize   PFree  
  /dev/sda        lvm2 ---  128.00m 128.00m

When all works correctly with the fixed version, the last command shouldn't display anything as we reject all devices with the filter!

Comment 7 errata-xmlrpc 2015-08-24 07:49:55 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.


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