• Aditya Kali's avatar
    ext4: Adding error check after calling ext4_mb_regular_allocator() · 6c7a120a
    Aditya Kali authored
    If the bitmap block on disk is bad, ext4_mb_load_buddy() returns an
    error. This error is returned to the caller,
    ext4_mb_regular_allocator() and then to ext4_mb_new_blocks().  But
    ext4_mb_new_blocks() did not check for the return value of
    ext4_mb_regular_allocator() and would repeatedly try to load the
    bitmap block. The fix simply catches the return value and exits out of
    the 'repeat' loop after cleanup.
    
    We also take the opportunity to clean up the error handling in
    ext4_mb_new_blocks().
    
    Google-Bug-Id: 2853530
    Signed-off-by: default avatarAditya Kali <adityakali@google.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    6c7a120a
mballoc.c 127 KB