From patchwork Thu Aug 18 19:30:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9288751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBC08607FD for ; Fri, 19 Aug 2016 00:52:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACF11291A5 for ; Fri, 19 Aug 2016 00:52:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A152B29203; Fri, 19 Aug 2016 00:52:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17066291A5 for ; Fri, 19 Aug 2016 00:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbcHSAv5 (ORCPT ); Thu, 18 Aug 2016 20:51:57 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:3663 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754065AbcHSAt6 (ORCPT ); Thu, 18 Aug 2016 20:49:58 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.17/8.16.0.17) with SMTP id u7IJ4INR001888 for ; Thu, 18 Aug 2016 12:30:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=FC9ZeZVaNq5TAUiMs5LU4EhBpOf9opZGgyKp12O+7+I=; b=k5maqVPZHElRgipqh9IoreQnexu3L9DMLl1sSEs1jN+4hiA66ijWL8SFMhuTLY+MhWjC MaLCK7KJJNWNnW90pqC8hxdxfcpC/WeVy0f+zV3d1KHVVVp17jGdV8yey0RTyrWXJKxb frU2siE1g9Sc7f/2Cy3tG1v1Y48aFZC7Y7k= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0089730.ppops.net with ESMTP id 24w7vww70g-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Aug 2016 12:30:11 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 18 Aug 2016 15:30:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AVaBh4QUHvAFCRMGobCd38cqwVI6EzzIe7ABTjfnUFg=; b=HK25eXQjssAG/u9o3WwIsGLcoQOqML3ySqQJNgnt5LkbeY5UTdYFVwq2JgP6OhPWQE4jifqpXrFsWmerEH+AeFmAjCLyMzezUP5KxaLm/ApXC48B5yfyHlgr2pwDr0QbbHLvntJ9xN/3RfGAlPFyVFybEZ+dJQV586P//FSfCfs= Received: from localhost (107.15.72.49) by DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.557.21; Thu, 18 Aug 2016 19:30:08 +0000 From: Josef Bacik To: Subject: [PATCH] Btrfs: fix em leak in find_first_block_group Date: Thu, 18 Aug 2016 15:30:06 -0400 Message-ID: <1471548606-1433-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [107.15.72.49] X-ClientProxiedBy: DM5PR17CA0024.namprd17.prod.outlook.com (10.168.112.162) To DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) X-MS-Office365-Filtering-Correlation-Id: 689781ea-64fe-4071-d488-08d3c79e1068 X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 2:uhPDCFvwcfdfe0HTyqp7zN7AmQJvMGVT2dUHREpTjVnz8ZeZL0rJ+Fm1eloiEGc9M4Rvsv04wgRxZVyUmcbNZsI3qYEksRaRkNPQLjmp7Hyxfncl7j9Wyc82BdG0SXCQ+iVjOYigcJ31En5A/anVyWN2l56Y1e4K0hIal4nt4E89C5GOnmcQrluWciR3QQOH; 3:bELJH/IZGZ1MoB88Eo9hq0zmS8epcPjfytXWz0C1ox/nra2qw1Ejo1AIA3lL+wF57fWq8Agbg7jnvVvBSlV2ZKQj72+1hLjZCFJDXOH+we45Tikuaqf9slsVkQgxm5Ph X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1321; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 25:z3rqKkD+JnB8zXDsN0b6odcD1MV8yNotLeyHL43jD224NBW5Npz+cCh8Yu5Icp9fuN4SmjNFFSkyd51qrlZyM2f52Ws/Ce9DSOS6kY8YyPHYwG3arOgtiTF8AoWFNlbSnelKoMaIB5arqfn2RCgqwYDVveDEsW8JeODw9y+Jj8WUqkuaL1iVMSst6iebnexB3uL6F9+xoLYkhnya3VF/M4SrPlf7qS/oup2jOhf0XR1k/5JbxKC/ZwV6HmeFL1nBgzV8YLozLQsEoBuz73s/RQBOoDiztCEpz75KYjOqE/skAtKOq4EtWf5FdZpOds8E3VPVkFfYTfK9w8dDpSLKaaK8Zc5oIGxkwou76OuHmgZo85L/atKdKNGde++s8eT5RKINLLDwDWQGIUwmbl63JJnuzYTzvr392J3cb24Uq4XxPajBvDHUxBm0HirHhL8W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X0RRGry3rukp8wV51B9JFcYQdM62qAww/+Wolk3XOoFFDNnL8eqAJOxyCRmkW/YhEKWnqI8THVitOHWsu3hTutUDyU+Evh8LUh938WQNIRvJYZEfqsfxvupJnGy6uDmz7J X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:DM5PR15MB1321; BCL:0; PCL:0; RULEID:; SRVR:DM5PR15MB1321; X-Forefront-PRVS: 0038DE95A2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(76506005)(229853001)(305945005)(2351001)(450100001)(5003940100001)(36756003)(92566002)(50466002)(101416001)(19580395003)(77096005)(105586002)(19580405001)(48376002)(50986999)(106356001)(2906002)(33646002)(97736004)(42186005)(47776003)(189998001)(586003)(6116002)(3846002)(68736007)(86362001)(7846002)(110136002)(7736002)(81166006)(8676002)(81156014)(50226002)(107886002)(66066001)(4720700001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1321; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR15MB1321; 23:upy74QUIh6uqDHIDzAu4m5qDst6IZ+VddL+dxEefd?= =?us-ascii?Q?SGoWLhRexJIN/NyF6f7Pl2oSDXuoXmhbPebjOIzMDTSMZEOqcmywnyjxN4Mt?= =?us-ascii?Q?YtkTSn6B9RY7GeRcaWP5C/VPqpXQdOAw9XYT+V1RSR4aglqMIwhMTeXq43/8?= =?us-ascii?Q?nbL0c4K7VL/jmNNwzxCCCIxIW7jbMor5Wzkej0Z+KbYcFATdnYLvSVl8ZNZB?= =?us-ascii?Q?zP2wThX308nrPjHv6a2W9IZtOyHd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Q?UAQLIgRR9U=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 6:Chr9kIM+wlEx22REGuJ4tLdDKIGXw5jVghHSK7crqJHpPFmSiOpCwnauAaZpGyjzsSdsZPgRkr8N3JgImepU9FTAjrck1wPC6hjg2sEVBiNwXHALvy1uEXwIdNLYwzu36H+ec90M6iqh3gJyxo+PcE/phUERsx0Go9z8gbYaArbWScHjJJet1ur1XAFoMVPu0HhZBqEzXY8J0W5L6UjAT8luB+I4pqj3fiUV3H4uxYe3FjvC3p7x6llIK6Sq2jIw9FRzt2SXQ7xQ816E/JKUuQbDW1QLFvpW/GzjtNnE7Ws=; 5:Kg53AMHBXq6kS5vyHvw2UI4LeEXOHAX8TSMob6gRPhgSVBGSfYtvwhSNVatPQDty+a9lGElx2N7R1j9tLxkgGi/sdjmCa/jrN5wV13JLoexkX1PtcuQMbWSPbenS1r8DaSBvMSrAmMyayeYsIEaMEQ==; 24:HaTKtst+ZM+IF18yYvu40QFo62K15kpUlhMyInOoj5rJpTy1+EOXbgRC4OdYYBpJlExAhsx+CnqZSDjBzrgR6z1sDcdJmXO8KXwdMdTL+Lg=; 7:MARtalQzl/iqJO801icxrdjiJGCCp1BfgZgbcV895VgO/TF3CCeofXb4mxczoDHDOGYyXTSrC9vGHrqHfb9jnAGZL0/xvAgPI9E/770K0JlMdd2c+F08lBevacbCnAKwfs7HX6/rC0RRHk4dyRDyEM5AS89gWIVmhtodvIM2V/XeZKFTXS/tGqIx4i12JVraylmYVx4Gc4KkQAPGbvpgeIlhU0zV3IojYJz3nRGaM0ci1QgwZRHR1gX4qmCI8Csb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 20:zWCsoGt7mehCbRXdsCCNl2jdKCCmWF27rpBiH9fLp9/6DU3jMu+Ei1fTSL591ZC32pJUMhXVd5TOqYpFl6Hm+y3tjXC++WVPxrgNT6F/QiRbTXugx5bPfQZxYWzOVkaBCartyjva4tu2Wsoo/oN800cxDhiBl4tYfGIMuqazMIc= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2016 19:30:08.1806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1321 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-18_09:, , signatures=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in find_first_block_group We need to call free_extent_map() on the em we look up. Signed-off-by: Josef Bacik Reviewed-by: Omar Sandoval Reviewed-by: Liu Bo --- fs/btrfs/extent-tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 61b494e..20f9fa6 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -9906,6 +9906,7 @@ static int find_first_block_group(struct btrfs_root *root, } else { ret = 0; } + free_extent_map(em); goto out; } path->slots[0]++;