Skip to contentSkip to conversation

Patch "btrfs: fix memory leak in update_space_info failure path" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Jun 12, 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: fix memory leak in update_space_info failure path

to the 3.18-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-fix-memory-leak-in-update_space_info-failure-path.patch
and it can be found in the queue-3.18 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 896533a7da929136d0432713f02a3edffece2826 Mon Sep 17 00:00:00 2001

From: Jeff Mahoney <[email protected]>
Date: Wed, 17 May 2017 09:49:37 -0400
Subject: btrfs: fix memory leak in update_space_info failure path

From: Jeff Mahoney <[email protected]>

commit 896533a7da929136d0432713f02a3edffece2826 upstream.

If we fail to add the space_info kobject, we'll leak the memory for the percpu counter.

Fixes 6ab0a2029c (btrfs: publish allocation data in sysfs)
---
 fs/btrfs/extent-tree.c |    1 +
 1 file changed, 1 insertion(+)
fs/btrfs/extent-tree.c +1 -0
@@ -3509,6 +3509,7 @@ static int update_space_info(struct btrf
 				    info->space_info_kobj, "%s",
 				    alloc_name(found->flags));
 	if (ret) {
+		percpu_counter_destroy(&found->total_bytes_pinned);
 		kfree(found);
 		return ret;
 	}

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

queue-3.18/btrfs-fix-memory-leak-in-update_space_info-failure-path.patch