Commit 8a249a8e authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Greg Kroah-Hartman

ext4: fix memory leak in ext4_free_branches

commit 1c5b9e90 upstream.

Commit 40389687 moved a call to ext4_forget() out of
ext4_free_branches and let ext4_free_blocks() handle calling
bforget().  But that change unfortunately did not replace the call to
ext4_forget() with brelse(), which was needed to drop the in-use count
of the indirect block's buffer head, which lead to a memory leak when
deleting files that used indirect blocks.  Fix this.

Thanks to Hugh Dickins for pointing this out.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3d597eb5
...@@ -4349,6 +4349,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, ...@@ -4349,6 +4349,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
(__le32 *) bh->b_data, (__le32 *) bh->b_data,
(__le32 *) bh->b_data + addr_per_block, (__le32 *) bh->b_data + addr_per_block,
depth); depth);
brelse(bh);
/* /*
* Everything below this this pointer has been * Everything below this this pointer has been
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment