• NeilBrown's avatar
    md/raid5: be more careful about write ordering when reshaping. · ab69ae12
    NeilBrown authored
    When we are reshaping an array, it is very important that we read
    the data from a particular sector offset before writing new data
    at that offset.
    
    In most cases when growing or shrinking an array we read long before
    we even consider writing.  But when restriping an array without
    changing it size, there is a small possibility that we might have
    some data to available write before the read has happened at the same
    location.  This would require some stripes to be in cache already.
    
    To guard against this small possibility, we check, before writing,
    that the 'old' stripe at the same location is not in the process of
    being read.  And we ensure that we mark all 'source' stripes as such
    before allowing new 'destination' stripes to proceed.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    ab69ae12
raid5.c 148 KB