Skip to content
Commit 4d9bcadd authored by Ernesto A. Fernández's avatar Ernesto A. Fernández Committed by Jan Kara
Browse files

ext2: Fix memory leak when truncate races ext2_get_blocks



Buffer heads referencing indirect blocks may not be released if the file
is truncated at the right time. This happens because ext2_get_branch()
returns NULL when it finds the whole chain of indirect blocks already
set, and when truncate alters the chain this value of NULL is
treated as the address of the last head to be released. Handle this in the
same way as it's done after the got_it label.

Signed-off-by: default avatarErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 08db141b
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