stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "btrfs: fix memory leak in update_space_info failure path" has been added to the 4.11-stable tree
@ 2017-06-12  9:18 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-06-12  9:18 UTC (permalink / raw)
  To: jeffm, bo.li.liu, dsterba, gregkh; +Cc: stable, stable-commits


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 4.11-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-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 896533a7da929136d0432713f02a3edffece2826 Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: Wed, 17 May 2017 09:49:37 -0400
Subject: btrfs: fix memory leak in update_space_info failure path

From: Jeff Mahoney <jeffm@suse.com>

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)
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/btrfs/extent-tree.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3983,6 +3983,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 jeffm@suse.com are

queue-4.11/btrfs-fix-memory-leak-in-update_space_info-failure-path.patch
queue-4.11/btrfs-fix-race-with-relocation-recovery-and-fs_root-setup.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-12  9:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-12  9:18 Patch "btrfs: fix memory leak in update_space_info failure path" has been added to the 4.11-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).