Repository navigation
Fix BSD disklabel partition mount points and NetBSD UUIDs - #3876
Conversation
The shared Disklabel parser took a partition row's last token as its mount point. OpenBSD writes the fstab mount point in a trailing comment, but a partition fstab does not list has no comment, so it reported the cpg column (12960). NetBSD never writes a mount point: its comment is the cylinder range, so partitions reported "63)". NetBSD has no DUID either, so every UUID read ".a", ".e" and so on. - Disklabel.parseMountPoint reads the text after '#', and nothing for a row with no comment or a cylinder range. - The UUID is empty where the disk has no DUID. - NetBSD fills disklabel partitions' mount points from the df map it already reads for wedges. Fixtures are captured as root from NetBSD 10.1 and OpenBSD 7.9 in a throwaway fork workflow, which also ran the change against a file-backed disklabel disk on NetBSD and an fstab-less partition on OpenBSD.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3876 +/- ##
============================================
+ Coverage 81.21% 81.23% +0.01%
Complexity 937 937
============================================
Files 726 726
Lines 26773 26788 +15
Branches 4570 4574 +4
============================================
+ Hits 21745 21761 +16
+ Misses 2797 2795 -2
- Partials 2231 2232 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Found during the #3844 join-key survey. OpenBSD and NetBSD share
Disklabel.parseDiskParams(), which took the last whitespace token of a partition row as the mount point.fstabmount point as a trailing comment (# /usr). A partition thatfstabdoes not list has no comment, so its row ends at thecpgcolumn, andgetMountPoint()returned12960.# (Cyl. 0 - 63), so every disklabel partition reported63). NetBSD also has no DUID, sogetUuid()returned.a,.eand so on.Change
Disklabel.parseMountPoint(): the text after#, or empty for a row with no comment or with a cylinder range.NetBsdHWDiskStorefills in disklabel partitions' mount points from thedfmap it already reads for wedges (withMountPoints). A partition that already has a mount point, as thedffallback's do, keeps it.Left unchanged: OpenBSD swap still reports
none(it is infstab), and rows with four or fewer columns (OpenBSD'sc: … unused) are still skipped, as the existing test documents.Testing
disklabel vnd0on NetBSD 10.1, anddisklabel -n sd0on OpenBSD 7.9 with a partition removed fromfstab. There is also aparseMountPointunit test and awithMountPointstest.getDiskStores()partitions:vnd0with a real disklabel reportsvnd0awith mount/mnt/data, the unmountedvnd0ewith no mount, and empty UUIDs. The GPT wedges onld0are unchanged.sd0k, removed fromfstab, reports an empty mount point. Every other partition is unchanged.-Perror-proneinstall with tests, checkstyle, forbidden APIs, javadoc).Summary by CodeRabbit
/etc/fstabentry are handled correctly.