Skip to contentSkip to conversation

Patch "Btrfs: don't leak reloc root nodes on error" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jan 4, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

Btrfs: don't leak reloc root nodes on error

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
btrfs-don-t-leak-reloc-root-nodes-on-error.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 6bdf131fac2336adb1a628f992ba32384f653a55 Mon Sep 17 00:00:00 2001

From: Josef Bacik <[email protected]>
Date: Fri, 2 Sep 2016 15:25:43 -0400
Subject: Btrfs: don't leak reloc root nodes on error

From: Josef Bacik <[email protected]>

commit 6bdf131fac2336adb1a628f992ba32384f653a55 upstream.

We don't track the reloc roots in any sort of normal way, so the only way the root/commit_root nodes get free'd is if the relocation finishes successfully and the reloc root is deleted. Fix this by free'ing them in free_reloc_roots. Thanks,

---
 fs/btrfs/relocation.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/btrfs/relocation.c +4 -0
@@ -2350,6 +2350,10 @@ void free_reloc_roots(struct list_head *
 	while (!list_empty(list)) {
 		reloc_root = list_entry(list->next, struct btrfs_root,
 					root_list);
+		free_extent_buffer(reloc_root->node);
+		free_extent_buffer(reloc_root->commit_root);
+		reloc_root->node = NULL;
+		reloc_root->commit_root = NULL;
 		__del_reloc_root(reloc_root);
 	}
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/btrfs-return-gracefully-from-balance-if-fs-tree-is-corrupted.patch queue-4.4/btrfs-don-t-bug-during-drop-snapshot.patch queue-4.4/btrfs-don-t-leak-reloc-root-nodes-on-error.patch