]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: write initial ppl on a disk added for rebuild
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Thu, 28 Sep 2017 12:41:18 +0000 (14:41 +0200)
committerJes Sorensen <jsorensen@fb.com>
Mon, 2 Oct 2017 20:15:49 +0000 (16:15 -0400)
When rebuild is initiated by the UEFI driver it is possible that the new
disk will not contain a valid ppl header. Just write the initial ppl
and don't abort assembly.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c

index cf5d8226996a7a5274e5c229387ed8695aa61ee7..536cb6134314c99e1874dc1b95b07ea798d60e0d 100644 (file)
@@ -6227,7 +6227,10 @@ out:
 
                if (map->map_state == IMSM_T_STATE_UNINITIALIZED ||
                   (map->map_state == IMSM_T_STATE_NORMAL &&
-                  !(dev->vol.dirty & RAIDVOL_DIRTY)))
+                  !(dev->vol.dirty & RAIDVOL_DIRTY)) ||
+                  (dev->vol.migr_state == MIGR_REBUILD &&
+                   dev->vol.curr_migr_unit == 0 &&
+                   get_imsm_disk_idx(dev, disk->disk.raid_disk, MAP_1) != idx))
                        ret = st->ss->write_init_ppl(st, info, d->fd);
                else
                        info->mismatch_cnt++;