fix(smartpqi): handle failed drives and unassigned drives in arcconf …#139
Merged
Conversation
…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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
…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: