Files
linux/fs/ext4
Theodore Ts'o ccdbe7da07 ext4: fix BUG_ON in mb_free_blocks()
commit c99d1e6e83 upstream.

If we suffer a block allocation failure (for example due to a memory
allocation failure), it's possible that we will call
ext4_discard_allocated_blocks() before we've actually allocated any
blocks.  In that case, fe_len and fe_start in ac->ac_f_ex will still
be zero, and this will result in mb_free_blocks(inode, e4b, 0, 0)
triggering the BUG_ON on mb_free_blocks():

	BUG_ON(last >= (sb->s_blocksize << 3));

Fix this by bailing out of ext4_discard_allocated_blocks() if fs_len
is zero.

Also fix a missing ext4_mb_unload_buddy() call in
ext4_discard_allocated_blocks().

Google-Bug-Id: 16844242

Fixes: 86f0afd463
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-05 16:28:36 -07:00
..
2011-07-25 14:30:23 -04:00
2013-07-21 18:21:33 -07:00
2013-05-03 02:15:52 -04:00
2013-05-03 02:15:52 -04:00
2012-12-10 16:30:43 -05:00
2014-09-05 16:28:36 -07:00
2012-12-10 16:30:43 -05:00