From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:36330 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbdFLJTP (ORCPT ); Mon, 12 Jun 2017 05:19:15 -0400 Subject: Patch "btrfs: fix memory leak in update_space_info failure path" has been added to the 4.11-stable tree To: jeffm@suse.com, bo.li.liu@oracle.com, dsterba@suse.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 12 Jun 2017 11:18:57 +0200 Message-ID: <149725913716442@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 896533a7da929136d0432713f02a3edffece2826 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 17 May 2017 09:49:37 -0400 Subject: btrfs: fix memory leak in update_space_info failure path From: Jeff Mahoney 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 Reviewed-by: Liu Bo Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- 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