]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Modify mdstat parsing for volumes with the bitmap
authorJakub Radtke <jakub.radtke@intel.com>
Fri, 15 Jan 2021 05:46:54 +0000 (00:46 -0500)
committerJes Sorensen <jsorensen@fb.com>
Tue, 9 Mar 2021 22:17:39 +0000 (17:17 -0500)
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>
mdstat.c

index dd96cca7aba1c08a0aef8cf1f82b734a66724cec..2fd792c5d56de1ce4547efd3a3c2fcd71ab96a87 100644 (file)
--- 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*/) {