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 1549498 - Infinite loop in case of LV and PV have the same name
Summary: Infinite loop in case of LV and PV have the same name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dracut
Version: 7.4
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1546815 1549617 1551061
TreeView+ depends on / blocked
 
Reported: 2018-02-27 09:40 UTC by Welterlen Benoit
Modified: 2021-12-10 15:43 UTC (History)
7 users (show)

Fixed In Version: dracut-033-546.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:26:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3366631 0 None None None 2018-03-01 10:22:29 UTC
Red Hat Product Errata RHBA-2018:3232 0 None None None 2018-10-30 11:28:40 UTC

Description Welterlen Benoit 2018-02-27 09:40:41 UTC
Description of problem:
With LVM, if a LV has the same name than the PV, an infinite loop occurs in check_vol_slaves_all : 
dracut-functions.sh :
check_vol_slaves_all() {
    local _lv _vg _pv
    for i in /dev/mapper/*; do
        [[ $i == /dev/mapper/control ]] && continue
        _lv=$(get_maj_min $i)
        if [[ $_lv = $2 ]]; then
>>>>>            _vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
            # strip space
            _vg="${_vg//[[:space:]]/}"
            if [[ $_vg ]]; then
>>>>>                for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
                do
                    check_block_and_slaves_all $1 $(get_maj_min $_pv)
                done
                return 0
            fi
        fi
    done
    return 1
}

Version-Release number of selected component (if applicable):
dracut-033-502.el7.x86_64 - RHEL 7.4

How reproducible:
Easy

Steps to Reproduce:
1. pvcreate vg_swap  /dev/mapper/vg_swap
2. vgcreate vg_swap /dev/mapper/vg_swap
3. lvcreate -L100 vg_swap
4. > dracut loops

  PV                     VG                  Fmt  Attr PSize   PFree                                                                                                                                                                                                                                                 
  /dev/mapper/vg_swap vg_swap lvm2 a--  100.00m    0 

Actual results:
Infinite loop, can't install new kernel with security fixes.

Expected results:
Initramfs generated

Additional info:
Workaround is to rename the VG

Comment 2 Lukáš Nykrýn 2018-03-01 13:31:22 UTC
I think we need to backport:
https://github.com/dracutdevs/dracut/commit/9ed6eb741f0bc0178167e7063751eb2bb4ac6de5

Comment 4 Jan Stodola 2018-03-28 10:16:35 UTC
Welterlen, I'm not able to reproduce this issue with dracut-033-502.el7 and the following steps:

[root@localhost ~]# pvcreate /dev/mapper/vg_swap 
  Physical volume "/dev/mapper/vg_swap" successfully created.
[root@localhost ~]# vgcreate vg_swap /dev/mapper/vg_swap 
  Volume group "vg_swap" successfully created
[root@localhost ~]# lvcreate -l 100%FREE -n vg_swap vg_swap
  Logical volume "vg_swap" created.
[root@localhost ~]#

[root@localhost ~]# pvs
  PV                  VG      Fmt  Attr PSize  PFree
  /dev/mapper/vg_swap vg_swap lvm2 a--  <2.00g    0 
[root@localhost ~]# lvs
  LV      VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vg_swap vg_swap -wi-a----- <2.00g                                                    
[root@localhost ~]# dracut /tmp/test
[root@localhost ~]# rpm -q dracut
dracut-033-502.el7.x86_64
[root@localhost ~]#

Is there something else I need to run?

Comment 5 Welterlen Benoit 2018-03-28 13:19:20 UTC
Hello Jan,

If the device is not automatically included to be managed by the initramfs, you have to add it :

dracut --force -vvvv /tmp/test  --add-device /dev/mapper/vg_swap

else it would not be listed.

Let me know if it still works.

Benoit

Comment 6 Jan Stodola 2018-03-28 13:46:30 UTC
Thank you, Benoit!
I can reproduce it now with the --add-device dracut option.

Comment 7 Harald Hoyer 2018-03-29 06:33:48 UTC
This should fix the issue:

https://github.com/dracutdevs/dracut/commit/e64dafd1f2489f1d926cce3e3bfd33f62b29b192

Comment 8 Welterlen Benoit 2018-03-29 07:52:20 UTC
And this one pointed by Lukas ?
https://github.com/dracutdevs/dracut/commit/9ed6eb741f0bc0178167e7063751eb2bb4ac6de5

Comment 9 Harald Hoyer 2018-03-29 09:57:56 UTC
(In reply to Welterlen Benoit from comment #8)
> And this one pointed by Lukas ?
> https://github.com/dracutdevs/dracut/commit/
> 9ed6eb741f0bc0178167e7063751eb2bb4ac6de5

This improves the performance, if you have a lot of device-mapper devices.

Comment 13 Jan Stodola 2018-07-25 12:33:04 UTC
Reproduced on RHEL-7.5 GA using a multipath device:

[root@localhost ~]# pvcreate /dev/mapper/mpatha1 
WARNING: xfs signature detected on /dev/mapper/mpatha1 at offset 0. Wipe it? [y/n]: y  
  Wiping xfs signature on /dev/mapper/mpatha1.
  Physical volume "/dev/mapper/mpatha1" successfully created.
[root@localhost ~]# vgcreate mpatha1 /dev/mapper/mpatha1 
  Volume group "mpatha1" successfully created
[root@localhost ~]# lvcreate -l 100%FREE -n mpath1 mpath1
  Volume group "mpath1" not found
  Cannot process volume group mpath1
[root@localhost ~]# lvcreate -l 100%FREE -n mpatha1 mpatha1
  Logical volume "mpatha1" created.
[root@localhost ~]# pvs
  PV                  VG      Fmt  Attr PSize PFree
  /dev/mapper/mpatha1 mpatha1 lvm2 a--  5.99g    0 
[root@localhost ~]# lvs
  LV      VG      Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  mpatha1 mpatha1 -wi-a----- 5.99g                                                    
[root@localhost ~]# dracut --force -vvvv /tmp/test --add-device /dev/mapper/mpatha1
Executing: /usr/sbin/dracut --force -vvvv /tmp/test --add-device /dev/mapper/mpatha1
^C[root@localhost ~]# rpm -q dracut
dracut-033-535.el7.x86_64
[root@localhost ~]#

Verified with dracut-033-547.el7:

[root@localhost ~]# dracut --force -vvvv /tmp/test --add-device /dev/mapper/mpatha1
Executing: /usr/sbin/dracut --force -vvvv /tmp/test --add-device /dev/mapper/mpatha1
dracut module 'modsign' will not be installed, because command 'keyctl' could not be found!
dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
...
*** Creating initramfs image file '/tmp/test' done ***
[root@localhost ~]# ls -l /tmp/test 
-rw-------. 1 root root 22805437 Jul 25 14:12 /tmp/test
[root@localhost ~]# rpm -q dracut
dracut-033-547.el7.x86_64
[root@localhost ~]#

Moving to VERIFIED.

Comment 15 errata-xmlrpc 2018-10-30 11:26:36 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.

https://access.redhat.com/errata/RHBA-2018:3232


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