Bug 2090949
| Summary: | When using the argument --devicesfile a misspelled filename results in no filter being used. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Lance Digby <ldigby> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| lvm2 sub component: | Devices, Filtering and Stacking | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | high | ||
| Priority: | high | CC: | agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, teigland, zkabelac |
| Version: | 8.6 | Keywords: | Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.03.14-5.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-11-08 10:55:29 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: | |||
|
Comment 1
David Teigland
2022-05-27 14:15:41 UTC
fixed in main branch https://sourceware.org/git/?p=lvm2.git;a=commit;h=bfe072e4388b530cbf5369be8a8f1305220198bf devices file: fail if --devicesfile filename doesn't exist A typo of the filename after --devicesfile should result in a command error rather than the command falling back to using no devices file at all. Exception is vgcreate|pvcreate which create a new devices file if the file name doesn't exist. According to comment #2, we should be failing when the non default file is missing. kernel-4.18.0-398.g366e.el8.kpq1 BUILT: Tue Jun 7 04:56:38 CDT 2022 lvm2-2.03.14-4.el8 BUILT: Wed Jun 15 17:14:34 CDT 2022 lvm2-libs-2.03.14-4.el8 BUILT: Wed Jun 15 17:14:34 CDT 2022 device-mapper-1.02.181-4.el8 BUILT: Wed Jun 15 17:14:34 CDT 2022 [root@hayes-01 ~]# lvcreate --yes --type linear -n dflinear --devicesfile pers.devices -L 500M df Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. Volume group "df" not found Cannot process volume group df [root@hayes-01 ~]# echo $? 5 [root@hayes-01 ~]# lvs -a -o +devices --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. [root@hayes-01 ~]# echo $? 0 [root@hayes-01 ~]# lvscan --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. [root@hayes-01 ~]# echo $? 0 [root@hayes-01 ~]# lvdisplay --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. [root@hayes-01 ~]# echo $? 0 (In reply to Corey Marthaler from comment #8) > According to comment #2, we should be failing when the non default file is > missing. Pushed a fix to use an error exit code when the --devicesfile name doesn't exist. main branch: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92b4fcf57f3c6d212d06b72b097e1a06e6efb84b rhel-8.7.0 branch: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73b9a2805ca2f2c70f6f631b405f8fea3f72f23b Marking Verified:Tested (and moving to MODIFIED since there's a fixed in version list). kernel-4.18.0-409.el8 BUILT: Tue Jul 12 00:16:54 CDT 2022 lvm2-2.03.14-5.el8 BUILT: Thu Jul 14 09:23:13 CDT 2022 lvm2-libs-2.03.14-5.el8 BUILT: Thu Jul 14 09:23:13 CDT 2022 SCENARIO - use_of_devicesfile_as_an_argument_for_non_create_power_cmds: Check the usage of --devicesfile as an argument for a variety of LVM commands that do NOT have the power to create the devices file (bug 2090949) adding entry to the devices file for /dev/sde1 creating PV on hayes-01 using device /dev/sde1 pvcreate --yes -ff /dev/sde1 Physical volume "/dev/sde1" successfully created. adding entry to the devices file for /dev/sdd1 creating PV on hayes-01 using device /dev/sdd1 pvcreate --yes -ff /dev/sdd1 Physical volume "/dev/sdd1" successfully created. adding entry to the devices file for /dev/sdh1 creating PV on hayes-01 using device /dev/sdh1 pvcreate --yes -ff /dev/sdh1 Physical volume "/dev/sdh1" successfully created. adding entry to the devices file for /dev/sdi1 creating PV on hayes-01 using device /dev/sdi1 pvcreate --yes -ff /dev/sdi1 Physical volume "/dev/sdi1" successfully created. creating VG on hayes-01 using PV(s) /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1 vgcreate df /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1 Volume group "df" successfully created lvcreate --yes --type linear -n dflinear --devicesfile pers.devices -L 500M df Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. lvcreate --yes --type linear -n dflinear -L 500M df Logical volume "dflinear" created. lvs -a -o +devices --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. lvscan --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. lvdisplay --devicesfile pers.devices Devices file not found: /etc/lvm/devices/pers.devices Failed to set up devices. lvremove -f df/dflinear Logical volume "dflinear" successfully removed. removing vg df from hayes-01 Volume group "df" successfully removed removing pv /dev/sde1 on hayes-01 Labels on physical volume "/dev/sde1" successfully wiped. removing entry from the devices file for /dev/sde1 removing pv /dev/sdd1 on hayes-01 Labels on physical volume "/dev/sdd1" successfully wiped. removing entry from the devices file for /dev/sdd1 removing pv /dev/sdh1 on hayes-01 Labels on physical volume "/dev/sdh1" successfully wiped. removing entry from the devices file for /dev/sdh1 removing pv /dev/sdi1 on hayes-01 Labels on physical volume "/dev/sdi1" successfully wiped. removing entry from the devices file for /dev/sdi1 SCENARIO - use_of_devicesfile_as_an_argument_for_create_power_cmds: Check the usage of --devicesfile as an argument for a variety of LVM commands that HAVE the power to create the devices file (bug 2101025) adding entry to the devices file for /dev/sde1 creating PV on hayes-01 using device /dev/sde1 pvcreate --yes -ff --devicesfile pers.devices /dev/sde1 Physical volume "/dev/sde1" successfully created. PV creation should NOT have passed adding entry to the devices file for /dev/sde1 creating PV on hayes-01 using device /dev/sde1 pvcreate --yes -ff /dev/sde1 Physical volume "/dev/sde1" successfully created. adding entry to the devices file for /dev/sdd1 creating PV on hayes-01 using device /dev/sdd1 pvcreate --yes -ff /dev/sdd1 Physical volume "/dev/sdd1" successfully created. adding entry to the devices file for /dev/sdh1 creating PV on hayes-01 using device /dev/sdh1 pvcreate --yes -ff /dev/sdh1 Physical volume "/dev/sdh1" successfully created. adding entry to the devices file for /dev/sdi1 creating PV on hayes-01 using device /dev/sdi1 pvcreate --yes -ff /dev/sdi1 Physical volume "/dev/sdi1" successfully created. creating VG on hayes-01 using PV(s) /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1 vgcreate --devicesfile pers.devices df /dev/sde1 /dev/sdd1 /dev/sdh1 /dev/sdi1 Device /dev/sde1 has PVID sNNJ18iUkIbMtp3SNrEnLDgwk0vOoeJZ (devices file cxxa76bGeCLmmDfcMa49kU1fCD8jzUNc) Volume group "df" successfully created VG creation should NOT have passed Volume group "df" successfully removed removing pv /dev/sde1 on hayes-01 Labels on physical volume "/dev/sde1" successfully wiped. removing entry from the devices file for /dev/sde1 removing pv /dev/sdd1 on hayes-01 Labels on physical volume "/dev/sdd1" successfully wiped. removing entry from the devices file for /dev/sdd1 removing pv /dev/sdh1 on hayes-01 Labels on physical volume "/dev/sdh1" successfully wiped. removing entry from the devices file for /dev/sdh1 removing pv /dev/sdi1 on hayes-01 Labels on physical volume "/dev/sdi1" successfully wiped. removing entry from the devices file for /dev/sdi1 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-2022:7792 |