Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dracut-functions.sh): skip dir in get_persistent_dev() #2668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 30, 2024

  1. fix(dracut-functions.sh): skip dir in get_persistent_dev()

    I observed the following directory layout under /dev/disk/by-path:
    
    /dev/disk/by-path/
    ├── pci-0000:00:07.0 -> ../../vda
    ├── pci-0000:00:07.0-part
    │   ├── by-partnum
    │   │   ├── 1 -> ../../../../vda1
    │   │   ├── 2 -> ../../../../vda2
    │   │   └── 3 -> ../../../../vda3
    │   ├── by-partuuid
    │   │   ├── 102645f0-b6a7-47d5-93ae-60bd063ecbc5 -> ../../../../vda1
    │   │   ├── 32dc3e8a-70cb-4afb-8642-d4f2e0a92941 -> ../../../../vda3
    │   │   └── 46beb739-55c1-4746-ab90-b329a0c82ea5 -> ../../../../vda2
    │   └── by-uuid
    │       └── 11ea5cf3-7132-40d4-a114-a8d76edca51f -> ../../../../vda2
    ├── pci-0000:00:07.0-part1 -> ../../vda1
    ├── pci-0000:00:07.0-part2 -> ../../vda2
    ├── pci-0000:00:07.0-part3 -> ../../vda3
    ├── virtio-pci-0000:00:07.0 -> ../../vda
    ├── virtio-pci-0000:00:07.0-part1 -> ../../vda1
    ├── virtio-pci-0000:00:07.0-part2 -> ../../vda2
    └── virtio-pci-0000:00:07.0-part3 -> ../../vda3
    
    As showed above, 'pci-0000:00:07.0-part' is a directory, so
    get_maj_min() returns '0:0' for it.
    
    This will raise an issue in the case that kdump dumps the vmcore through
    nfs. In that case, no block device is passed to
    get_persistent_dev(), so _dev=$(get_maj_min "$1") also equals '0:0'.
    Finally, it wrongly fits into the match:
            if [ "$_tmp" = "$_dev" ]; then
                printf -- "%s" "$i"
                return
            fi
    
    And kdump kernel boots up and wait for 'pci-0000:00:07.0-part'
    indefinitely.
    
    Signed-off-by: Pingfan Liu <[email protected]>
    Pingfan Liu committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    8078eec View commit details
    Browse the repository at this point in the history