Skip to content

fix: populate Modalias for NVMe disks#158

Open
rothgar wants to merge 1 commit into
siderolabs:v2from
rothgar:nvme-modalias
Open

fix: populate Modalias for NVMe disks#158
rothgar wants to merge 1 commit into
siderolabs:v2from
rothgar:nvme-modalias

Conversation

@rothgar

@rothgar rothgar commented Jun 10, 2026

Copy link
Copy Markdown
Member

DeviceProperties.Modalias was empty for NVMe namespaces because the kernel exposes the PCI device at a different path than SCSI/ATA.

Copilot AI review requested due to automatic review settings June 10, 2026 19:23
@github-project-automation github-project-automation Bot moved this to To Do in Planning Jun 10, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Populates DeviceProperties.Modalias for NVMe namespaces by reading the modalias from an alternate sysfs path when the usual /device/modalias entry is missing, aligning NVMe behavior with SCSI/ATA devices.

Changes:

  • Replace direct sysfs modalias read with readBlockDeviceModalias() fallback logic.
  • Add readBlockDeviceModalias() helper to read /device/modalias and fall back to /device/device/modalias.
  • Add internal tests covering both “SCSI-style” and “NVMe-style” modalias layouts and precedence.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
block/device.go Updates DeviceProperties.Modalias field comment to describe the fallback sysfs location.
block/device_linux.go Uses a helper to read modalias with a fallback for NVMe namespaces.
block/device_linux_internal_test.go Adds unit tests to validate modalias fallback and precedence behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread block/device.go
Comment thread block/device_linux.go Outdated
DeviceProperties.Modalias was empty for NVMe namespaces because the
kernel exposes the PCI device at a different path than SCSI/ATA.

Signed-off-by: Justin Garrison <justin.garrison@siderolabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants