Bug 1044474

Summary: The global_filter is not properly applied for lvm2-pvscan@.service - only major:minor pair should be used, not device path for the service's "pvscan --cache -aay" call
Product: [Fedora] Fedora Reporter: Peter Rajnoha <prajnoha>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 20CC: agk, bmarzins, bmr, dwysocha, heinzm, jonathan, lvm-team, msnitzer, prajnoha, prockai, zkabelac
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.103-5.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-24 03:42:38 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 Peter Rajnoha 2013-12-18 11:47:42 UTC
The lvm2-pvscan@.service must use only "major:minor" for device reference, not /dev/block/major:minor (a path). Otherwise, the global_filter is not properly applied. This may end up with unexpected filtering of the devices that LVM should scan when someone has global_filter defined.

commit 359291b41cdeb1ca886e018aa44c67882da10252
Author: Peter Rajnoha <prajnoha>
Date:   Wed Dec 18 12:00:02 2013 +0100

    systemd: use only major:minor for pvscan in lvm2-pvscan@.service
    
    When using filters for the pvscan --cache (the global_filter),
    there's a difference between:
    
      pvscan --cache -aay /dev/block/<major>:<minor>
    
    and
    
      pvscan --cache -aay <major>:<minor> (or --major <major> --minor <minor>)
    
    In the first case, we need to be sure to have an exact matching line
    in the filter for the device to be used, no aliases are considered
    So for example even if we have accept rule for "/dev/sda" present,
    this won't apply for "/dev/block/8:0" even though it's the same device!
    This is because we're comparing the path used on command line directly
    with the path written in the rule.
    
    For the second one, any alias mentioned in the filter will apply
    as we're comparing the major and minor pair, not looking at actual
    device names - so any alias mentioned in the rules will suffice for
    the filtering rule to apply.
    
    For the global_filter to be properly used, we need to call the
    second one in the lvm2-pvscan@.service - nobody is able to tell
    what value of major:minor the kernel assignes next time, hence
    this bug makes the use of global_filter quite unusable!

(https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=359291b41cdeb1ca886e018aa44c67882da10252)

Comment 1 Fedora Update System 2013-12-18 12:08:07 UTC
lvm2-2.02.103-5.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/lvm2-2.02.103-5.fc20

Comment 2 Peter Rajnoha 2013-12-18 12:13:32 UTC
This bug may have caused the PVs to be incorrectly ignored (because of the global_filter use) while they were supposed to be visible and the LVM volumes may have ended up inactive while they were supposed to be activated.

Comment 3 Fedora Update System 2013-12-20 02:04:29 UTC
Package lvm2-2.02.103-5.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing lvm2-2.02.103-5.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23668/lvm2-2.02.103-5.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-12-24 03:42:38 UTC
lvm2-2.02.103-5.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.