]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: Write empty PPL header if assembling regular clean array.
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Thu, 28 Sep 2017 12:41:15 +0000 (14:41 +0200)
committerJes Sorensen <jsorensen@fb.com>
Mon, 2 Oct 2017 20:14:28 +0000 (16:14 -0400)
If array was initially assembled with kernel without PPL support -
initial header was never written to the drive.
If initial resync was completed and system is rebooted to kernel with
PPL support - mdadm prevents from assembling normal clean array
due to lack of valid PPL.
Write empty header when assemble normal clean array, so the
its assamble is no longer blocked.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c

index 7b2327bac3cf43e8d8211b8432416b5b2de3ad68..501d0c3cb7038c2cbb3b8121de8e9b97f2f3fbdb 100644 (file)
@@ -6225,7 +6225,9 @@ out:
        }
 
        if (ret == 1) {
-               if (map->map_state == IMSM_T_STATE_UNINITIALIZED)
+               if (map->map_state == IMSM_T_STATE_UNINITIALIZED ||
+                  (map->map_state == IMSM_T_STATE_NORMAL &&
+                  !(dev->vol.dirty & RAIDVOL_DIRTY)))
                        ret = st->ss->write_init_ppl(st, info, d->fd);
                else
                        info->mismatch_cnt++;