Modify mdstat parsing for volumes with the bitmap

Current mdstat read functionality is not working correctly
for the volumes with the write-intent bitmap.
It affects rebuild and reshape use cases.

Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Jakub Radtke 2021-01-15 00:46:54 -05:00 committed by Jes Sorensen
parent db5377883f
commit b090e91075
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ struct mdstat_ent *mdstat_read(int hold, int start)
else if (strcmp(w, "inactive") == 0) {
ent->active = 0;
in_devs = 1;
} else if (strcmp(w, "bitmap:") == 0) {
/* We need to stop parsing here;
* otherwise, ent->raid_disks will be
* overwritten by the wrong value.
*/
break;
} else if (ent->active > 0 &&
ent->level == NULL &&
w[0] != '(' /*readonly*/) {