• NeilBrown's avatar
    md/raid10: always set reshape_safe when initializing reshape_position. · 299b0685
    NeilBrown authored
    '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")
    Cc: stable@vger.kernel.org (v3.5+ please wait for -final to be out for 2 weeks)
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    299b0685
raid10.c 130 KB