From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:40872 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754910AbeCVNq4 (ORCPT ); Thu, 22 Mar 2018 09:46:56 -0400 Subject: Patch "Btrfs: fix extent map leak during fallocate error path" has been added to the 4.9-stable tree To: fdmanana@suse.com, alexander.levin@microsoft.com, dsterba@suse.com, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 22 Mar 2018 14:46:22 +0100 Message-ID: <15217263821227@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 extent map leak during fallocate error path to the 4.9-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-extent-map-leak-during-fallocate-error-path.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Mar 22 14:40:23 CET 2018 From: Filipe Manana Date: Mon, 3 Apr 2017 15:57:17 +0100 Subject: Btrfs: fix extent map leak during fallocate error path From: Filipe Manana [ Upstream commit be2d253cc98244765323a7c94cc1ac5cd5a17072 ] If the call to btrfs_qgroup_reserve_data() failed, we were leaking an extent map structure. The failure can happen either due to an -ENOMEM condition or, when quotas are enabled, due to -EDQUOT for example. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2817,8 +2817,10 @@ static long btrfs_fallocate(struct file } ret = btrfs_qgroup_reserve_data(inode, cur_offset, last_byte - cur_offset); - if (ret < 0) + if (ret < 0) { + free_extent_map(em); break; + } } else { /* * Do not need to reserve unwritten extent for this Patches currently in stable-queue which might be from fdmanana@suse.com are queue-4.9/btrfs-fix-incorrect-space-accounting-after-failure-to-insert-inline-extent.patch queue-4.9/btrfs-fix-extent-map-leak-during-fallocate-error-path.patch queue-4.9/btrfs-send-fix-file-hole-not-being-preserved-due-to-inline-extent.patch