dmraid-activate uses flawed logic to detect degraded condition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dmraid (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: dmraid
The dmraid-activate script attempts to detect if an array is degraded and only activate it if the degraded boot parameter has been set. The problem is the logic it uses to detect the degraded condition is flawed. Rather than check the number of devices that are MISSING, it checks the number of devices that are present. For a stripe, it checks that the device count is >= 2, but a 3+ disk stripe is still broken with only 2 disks present. For a mirror, it also checks for >= 2 disks, but you can have a 3 disk mirror with one disk missing, and this check would consider it to not be degraded. Finally for a raid5, it considers it to be degraded if there are less than 3 disks present, 3 out of 4 disks is also degraded. The relevant code is:
case "$Raid_Type" in
mode, not all devices present."
ating"
ating"
I believe the problem we're going to have with fixing this is determining how many disks were in the array to begin with. It requires reading specific data from the arrays descriptors and matching it to the drives listed. I would also recommend getting sector specific on the fix so that drives sharing multiple arrays won't bug when an already counted drive is counted again for another array.