fix(dracut-functions.sh): skip dir in get_persistent_dev() #2668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This pull request changes...
Changes
Checklist
Fixes #