• Xiao Ni's avatar
    md: fix max sectors calculation for super 1.0 · d9c0fa50
    Xiao Ni authored
    To grow size of super 1.0 raid array, it is necessary to check the device
    max usable size.
    
    Now it uses rdev->sectors for max usable size. If one disk is 500G and the
    raid device only uses the 100GB of this disk. rdev->sectors can't tell the
    real max usable size. The max usable size should be
    
    dev_size-(superblock_size+bitmap_size+badblock_size).
    
    Also, remove unnecessary sb_start update in super_1_rdev_size_change().
    Signed-off-by: default avatarXiao Ni <xni@redhat.com>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    d9c0fa50
md.c 259 KB