blockdev: exclude RAID member devices from filesystem label search#1745
Merged
prestist merged 2 commits intoMay 18, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves diagnostics when a labeled filesystem is missing by distinguishing between assembled filesystems and RAID member devices. It updates get_filesystems_with_label to exclude RAID members and introduces get_raid_members_with_label to detect them, accompanied by new unit tests for blkid parsing. Feedback from the review suggests optimizing performance by avoiding redundant partition table rereads and refactoring the label-searching logic into a single pass to minimize expensive block device scans.
0b1b003 to
6216b8e
Compare
c9a4e23 to
8af5251
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While investigating the issue, I found that get_filesystems_with_label() in blockdev.rs doesn't really account for RAID devices. When a RAID1 mirror boot is configured, blkid -p returns both (/dev/md127) and (/dev/sdb1) — both carrying the "boot" label but with different UUIDs. I dont think that the UUID deduplication will be suitable here... Soooo.. I filtered out RAID and I noticed we did not account for failed raid situations.. or bad state.. So I added a check in verify_unique_fs() that detects this case and reports which RAID devices are in a odd state.
fixes:#1731
Supported by claude