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): only return block devices from get_persistent_dev (SLFO) #361

Conversation

aafeijoo-suse
Copy link
Collaborator

With udev 256, there are now directories such as
/dev/disk/by-path/pci-0000:02:00.0-nvme-1-part/ which match here.

In case a nonexisting file/device was passed to get_persistent_dev, it returned the first directory it looked at because both have maj:min 0:0. This accidental conversion from garbage to a sensible looking path leads to weird behaviour later.

Instead of filtering out directories explicitly switch the check to only return block devices, which also takes care of the character special /dev/mapper/control.

(cherry picked from commit dracut-ng/dracut-ng@6611c6e)

…nt_dev

With udev 256, there are now directories such as
/dev/disk/by-path/pci-0000:02:00.0-nvme-1-part/ which match here.

In case a nonexisting file/device was passed to get_persistent_dev, it
returned the first directory it looked at because both have maj:min 0:0.
This accidental conversion from garbage to a sensible looking path leads
to weird behaviour later.

Instead of filtering out directories explicitly switch the check to only
return block devices, which also takes care of the character special
/dev/mapper/control.

(cherry picked from commit dracut-ng/dracut-ng@6611c6e)
@aafeijoo-suse aafeijoo-suse requested a review from tblume as a code owner August 9, 2024 06:26
Copy link
Collaborator

@tblume tblume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@aafeijoo-suse aafeijoo-suse merged commit e9a253e into openSUSE:SLFO_Main Aug 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants