Fix mdstat parsing of inactive RAID arrays, remove dead code
ClosedPublic

Authored by mpyne on Jul 12 2017, 8:09 PM.

Details

Summary

Something I noticed while doing the musl libc fixes:

  1. A GCC warning is generated for in_devs. It turns out the warning was referring to a Coverity entry (but the ID was wrong, it's 253228, not 3228), the Coverity entry noted that the in_devs code is dead code. And so it is. Whatever it was supposed to do before (warn about RAID entries using another RAID device as a sub-device?), it doesn't do it now --> removed.
  1. A boolean check for whether the raid array was active or not was miscoded (and therefore was always true). The compiler warning for this was actually what led to me looking through this code, but Coverity also flagged it as well. From inspection, the check actually is necessary since the "level" data we're extracting here is only present if the array is active, so I fixed by removing the errorneous condition.
Test Plan

Builds fine on glibc and musl libc.

However since I don't have a RAID array I have no good way of testing the change itself, though it should at least not break anything worse than it's already broken.

Diff Detail

Repository
R106 KSysguard
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mpyne created this revision.Jul 12 2017, 8:09 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 12 2017, 8:09 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mpyne added a comment.Jul 22 2017, 8:41 PM

If anyone has objections please let me know in the next few days.

This revision was automatically updated to reflect the committed changes.