• NeilBrown's avatar
    md/raid5: switch to use conf->chunk_sectors in place of mddev->chunk_sectors where possible · 3cb5edf4
    NeilBrown authored
    The chunk_sectors and new_chunk_sectors fields of mddev can be changed
    any time (via sysfs) that the reconfig mutex can be taken.  So raid5
    keeps internal copies in 'conf' which are stable except for a short
    locked moment when reshape stops/starts.
    
    So any access that does not hold reconfig_mutex should use the 'conf'
    values, not the 'mddev' values.
    Several don't.
    
    This could result in corruption if new values were written at awkward
    times.
    
    Also use min() or max() rather than open-coding.
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    3cb5edf4
raid5.c 220 KB