• Heinz Mauelshagen's avatar
    dm raid: fix oops on upgrading to extended superblock format · c4d097d1
    Heinz Mauelshagen authored
    When a RAID set was created on dm-raid version < 1.9.0 (old RAID
    superblock format), all of the new 1.9.0 members of the superblock are
    uninitialized (zero) -- including the device sectors member needed to
    support shrinking.
    
    All the other accesses to superblock fields new in 1.9.0 were reviewed
    and verified to be properly guarded against invalid use.  The 'sectors'
    member was the only one used when the superblock version is < 1.9.
    
    Don't access the superblock's >= 1.9.0 'sectors' member unconditionally.
    Also add respective comments.
    Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    c4d097d1
dm-raid.c 112 KB