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@xxxxxxxxxxxxxxx> know about it. >From 896533a7da929136d0432713f02a3edffece2826 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney <jeffm@xxxxxxxx> Date: Wed, 17 May 2017 09:49:37 -0400 Subject: btrfs: fix memory leak in update_space_info failure path From: Jeff Mahoney <jeffm@xxxxxxxx> 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@xxxxxxxx> Reviewed-by: Liu Bo <bo.li.liu@xxxxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- 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@xxxxxxxx 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