Skip to content

Commit 7ba5253

Browse files
committed
Add comment to explain the change in behaviour
Signed-off-by: David Asulin <[email protected]>
1 parent 066e436 commit 7ba5253

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/block/block_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ func disks(ctx *context.Context, paths *linuxpath.Paths) []*Disk {
331331
driveType, storageController := diskTypes(dname)
332332
// TODO(jaypipes): Move this into diskTypes() once abstracting
333333
// diskIsRotational for ease of unit testing
334+
// Only reclassify HDD to SSD if non-rotational to avoid changing already correct types.
335+
// This addresses changed kernel behavior where rotational detection may be unreliable,
336+
// where some kernels report CD-ROM drives as non-rotational, incorrectly classifying them as SSD.
334337
if !diskIsRotational(ctx, paths, dname) && driveType == DRIVE_TYPE_HDD {
335338
driveType = DRIVE_TYPE_SSD
336339
}

0 commit comments

Comments
 (0)