]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Reset bad flag on map update
authorCzarnowska, Anna <anna.czarnowska@intel.com>
Wed, 7 Mar 2012 12:51:30 +0000 (12:51 +0000)
committerNeilBrown <neilb@suse.de>
Wed, 7 Mar 2012 22:24:21 +0000 (09:24 +1100)
Map file may miss an entry if bad flag is not cleared on update.

This happens for example when an old entry exists in map that
has no mdstat counterpart and we create a new array with the same devnum.
Newly created array will not appear in map if update doesnt clear bad flag.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
mapfile.c

index 0bfecd05be9a7d504b3ffccb70dceb18e0f01b3f..9e2c89368c9cc2a0f997cbbc35e6165fa2dafe0d 100644 (file)
--- a/mapfile.c
+++ b/mapfile.c
@@ -246,6 +246,7 @@ int map_update(struct map_ent **mpp, int devnum, char *metadata,
                        memcpy(mp->uuid, uuid, 16);
                        free(mp->path);
                        mp->path = path ? strdup(path) : NULL;
+                       mp->bad = 0;
                        break;
                }
        if (!mp)