btrfs: drop block from cache on error in relocation
commit 8e19c9732a upstream.
If we have an error while building the backref tree in relocation we'll
process all the pending edges and then free the node. However if we
integrated some edges into the cache we'll lose our link to those edges
by simply freeing this node, which means we'll leak memory and
references to any roots that we've found.
Instead we need to use remove_backref_node(), which walks through all of
the edges that are still linked to this node and free's them up and
drops any root references we may be holding.
CC: stable@vger.kernel.org # 4.9+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d3a7c4b8d9
commit
d8ecdce154
1 changed files with 1 additions and 1 deletions
|
|
@ -1141,7 +1141,7 @@ out:
|
|||
free_backref_node(cache, lower);
|
||||
}
|
||||
|
||||
free_backref_node(cache, node);
|
||||
remove_backref_node(cache, node);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
ASSERT(!node || !node->detached);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue