Bug 1957040 - add a warning or a mention in devices/filter section that the devices file renders filters unusable
Summary: add a warning or a mention in devices/filter section that the devices file re...
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.5
Hardware: x86_64
OS: Linux
low
low
Target Milestone: beta
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-04 21:54 UTC by Corey Marthaler
Modified: 2021-05-06 14:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Corey Marthaler 2021-05-04 21:54:03 UTC
Description of problem:
This rfe is solely for users who did not read the LVMDEVICES(8) man page which clearly states: 
"With no devices file, lvm will use any device on the system, and applies the filter to limit the full set of system devices.  With a devices file, the regex filter is  not  used,  and  the filter settings in lvm.conf or the command line are ignored."


LVMDEVICES(8)
With no devices file, lvm will use any device on the system, and applies the filter to limit the full set of system devices.  With a devices file, the regex filter is  not  used,  and  the filter settings in lvm.conf or the command line are ignored.  The vgimportdevices command is one exception which does apply the regex filter when looking for a VG to import.

# using a filter *without* a devices file
[root@hayes-01 ~]# pvcreate /dev/sd[bcd]1
  Physical volume "/dev/sdb1" successfully created.
  Physical volume "/dev/sdc1" successfully created.
  Physical volume "/dev/sdd1" successfully created.
[root@hayes-01 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdb1     lvm2 ---  <1.82t <1.82t
  /dev/sdc1     lvm2 ---  <1.82t <1.82t
  /dev/sdd1     lvm2 ---  <1.82t <1.82t
# filter
[root@hayes-01 ~]# pvs --config "devices {filter = [ \"r|/dev/sdb1|\" ]"}
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdc1     lvm2 ---  <1.82t <1.82t
  /dev/sdd1     lvm2 ---  <1.82t <1.82t


# using a filter *with* a devices file
[root@hayes-02 ~]# pvcreate /dev/sd[bcd]1
  Physical volume "/dev/sdb1" successfully created.
  Physical volume "/dev/sdc1" successfully created.
  Physical volume "/dev/sdd1" successfully created.
[root@hayes-02 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdb1     lvm2 ---  <1.82t <1.82t
  /dev/sdc1     lvm2 ---  <1.82t <1.82t
  /dev/sdd1     lvm2 ---  <1.82t <1.82t
# filter does nothing
[root@hayes-02 ~]# pvs --config "devices {filter = [ \"r|/dev/sdb1|\" ]"}
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdb1     lvm2 ---  <1.82t <1.82t
  /dev/sdc1     lvm2 ---  <1.82t <1.82t
  /dev/sdd1     lvm2 ---  <1.82t <1.82t

# add filter to lvm.conf
[root@hayes-02 ~]# grep filter /etc/lvm/lvm.conf 
        filter = [ "r|/dev/sdb1|" ]

# filter does nothing
[root@hayes-02 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdb1     lvm2 ---  <1.82t <1.82t
  /dev/sdc1     lvm2 ---  <1.82t <1.82t
  /dev/sdd1     lvm2 ---  <1.82t <1.82t


Version-Release number of selected component (if applicable):
lvm2-2.03.12-0.1.20210426git4dc5d4a.el8    BUILT: Mon Apr 26 08:23:33 CDT 2021
lvm2-libs-2.03.12-0.1.20210426git4dc5d4a.el8    BUILT: Mon Apr 26 08:23:33 CDT 2021

Comment 1 David Teigland 2021-05-05 19:04:15 UTC
fix
https://sourceware.org/git/?p=lvm2.git;a=commit;h=71933d3496dfb21e1e39744d69f0372e202c1a1c

"Please remove the lvm.conf filter, it is ignored with the devices file." and/or
"Please remove the lvm.conf global_filter, it is ignored with the devices file."


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