• Heinz Mauelshagen's avatar
    dm raid: fix reshape race on small devices · 38b0bd0c
    Heinz Mauelshagen authored
    Loading a new mapping table, the dm-raid target's constructor
    retrieves the volatile reshaping state from the raid superblocks.
    
    When the new table is activated in a following resume, the actual
    reshape position is retrieved.  The reshape driven by the previous
    mapping can already have finished on small and/or fast devices thus
    updating raid superblocks about the new raid layout.
    
    This causes the actual array state (e.g. stripe size reshape finished)
    to be inconsistent with the one in the new mapping, causing hangs with
    left behind devices.
    
    This race does not occur with usual raid device sizes but with small
    ones (e.g. those created by the lvm2 test suite).
    
    Fix by no longer transferring stale/inconsistent raid_set state during
    preresume.
    Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    38b0bd0c
dm-raid.c 116 KB