• NeilBrown's avatar
    md/raid10: always set reshape_safe when initializing reshape_position. · f912b3e0
    NeilBrown authored
    commit 299b0685 upstream.
    
    'reshape_position' tracks where in the reshape we have reached.
    'reshape_safe' tracks where in the reshape we have safely recorded
    in the metadata.
    
    These are compared to determine when to update the metadata.
    So it is important that reshape_safe is initialised properly.
    Currently it isn't.  When starting a reshape from the beginning
    it usually has the correct value by luck.  But when reducing the
    number of devices in a RAID10, it has the wrong value and this leads
    to the metadata not being updated correctly.
    This can lead to corruption if the reshape is not allowed to complete.
    
    This patch is suitable for any -stable kernel which supports RAID10
    reshape, which is 3.5 and later.
    
    Fixes: 3ea7daa5 ("md/raid10: add reshape support")
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
    f912b3e0
raid10.c 131 KB