Skip to content

fix(smartpqi): handle failed drives and unassigned drives in arcconf …#139

Merged
raharper merged 1 commit into
project-machine:mainfrom
andaaron:arcconf
May 8, 2026
Merged

fix(smartpqi): handle failed drives and unassigned drives in arcconf …#139
raharper merged 1 commit into
project-machine:mainfrom
andaaron:arcconf

Conversation

@andaaron
Copy link
Copy Markdown
Contributor

@andaaron andaaron commented May 8, 2026

…parsing

Failed drives report "Block Size : 0 Bytes" because arcconf cannot query the hardware; treating this as a parse error caused disk scanning to abort for the entire controller. Block size zero is now accepted conditionally: only when the device is already marked Failed by the controller. Online or Ready devices still produce an error so unexpected zeros are not silently swallowed.

Unassigned physical drives (hot spares, unconfigured drives) have no "Array :" line in arcconf output, so their ArrayID field was silently defaulting to zero. This caused them to be linked into logical drive 0 during controller construction, corrupting IsSSD() for that RAID volume. Physical devices are now initialised with ArrayID = -1 as a sentinel; the linking loop in newController skips any drive with ArrayID < 0.

Tests added:

  • TestParsePhysicalDeviceBlockSizeZeroFailed: block size 0 parses cleanly for a Failed device.
  • TestParsePhysicalDeviceBlockSizeZeroOnlineErrors: block size 0 on an Online device is still an error.
  • TestNewControllerDegradedRAID5: synthetic degraded RAID5 fixture that exercises both fixes together, verifying correct LD membership and IsSSD() result.

…parsing

Failed drives report "Block Size : 0 Bytes" because arcconf cannot query
the hardware; treating this as a parse error caused disk scanning to abort
for the entire controller. Block size zero is now accepted conditionally:
only when the device is already marked Failed by the controller. Online or
Ready devices still produce an error so unexpected zeros are not silently
swallowed.

Unassigned physical drives (hot spares, unconfigured drives) have no
"Array :" line in arcconf output, so their ArrayID field was silently
defaulting to zero. This caused them to be linked into logical drive 0
during controller construction, corrupting IsSSD() for that RAID volume.
Physical devices are now initialised with ArrayID = -1 as a sentinel;
the linking loop in newController skips any drive with ArrayID < 0.

Tests added:
- TestParsePhysicalDeviceBlockSizeZeroFailed: block size 0 parses cleanly
  for a Failed device.
- TestParsePhysicalDeviceBlockSizeZeroOnlineErrors: block size 0 on an
  Online device is still an error.
- TestNewControllerDegradedRAID5: synthetic degraded RAID5 fixture that
  exercises both fixes together, verifying correct LD membership and
  IsSSD() result.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
@andaaron andaaron marked this pull request as ready for review May 8, 2026 18:20
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.57%. Comparing base (e79e163) to head (fad0929).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   52.45%   52.57%   +0.11%     
==========================================
  Files          29       29              
  Lines        3845     3850       +5     
==========================================
+ Hits         2017     2024       +7     
+ Misses       1610     1608       -2     
  Partials      218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@raharper raharper left a comment

Choose a reason for hiding this comment

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

Thanks.

@raharper raharper merged commit 03a0e16 into project-machine:main May 8, 2026
4 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.

2 participants