From b090e910756ea1165be5ac879746ab4bb83a2f91 Mon Sep 17 00:00:00 2001 From: Jakub Radtke Date: Fri, 15 Jan 2021 00:46:54 -0500 Subject: [PATCH] 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 Signed-off-by: Jes Sorensen --- mdstat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mdstat.c b/mdstat.c index dd96cca..2fd792c 100644 --- a/mdstat.c +++ b/mdstat.c @@ -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*/) {