ext4: Adding error check after calling ext4_mb_regular_allocator()
authorAditya Kali <adityakali@google.com>
Thu, 5 Aug 2010 20:22:24 +0000 (16:22 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 5 Aug 2010 20:22:24 +0000 (16:22 -0400)
commit6c7a120ac6c62316ab1fc78dfc0a7b13f3bfcbff
tree371f7d7050c42fbc8fb03a66233081a594df40b8
parent56d35a4cd13e7bc5eca5b2dba5a41794afb17e11
ext4: Adding error check after calling ext4_mb_regular_allocator()

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: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/mballoc.c