• Lukas Czerner's avatar
    ext4: verify block bitmap even after fresh initialization · 41e5b7ed
    Lukas Czerner authored
    If we want to rely on the buffer_verified() flag of the block bitmap
    buffer, we have to set it consistently. However currently if we're
    initializing uninitialized block bitmap in
    ext4_read_block_bitmap_nowait() we're not going to set buffer verified
    at all.
    
    We can do this by simply setting the flag on the buffer, but I think
    it's actually better to run ext4_validate_block_bitmap() to make sure
    that what we did in the ext4_init_block_bitmap() is right.
    
    So run ext4_validate_block_bitmap() even after the block bitmap
    initialization. Also bail out early from ext4_validate_block_bitmap() if
    we see corrupt bitmap, since we already know it's corrupt and we do not
    need to verify that.
    Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    41e5b7ed
balloc.c 25.4 KB