From patchwork Fri Jul 14 15:18:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 13313777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A8D1EB64DC for ; Fri, 14 Jul 2023 15:17:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235872AbjGNPRr (ORCPT ); Fri, 14 Jul 2023 11:17:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235325AbjGNPRq (ORCPT ); Fri, 14 Jul 2023 11:17:46 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 804CC1BD4 for ; Fri, 14 Jul 2023 08:17:45 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 42F5E220C3 for ; Fri, 14 Jul 2023 15:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689347864; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3wuF9bAx8hX6s5r5wVko0LuySvZyQk4HakmL7YtlCqc=; b=qOIACrYnEwt33at2a6+Xn4Z0uWcr8+vnMXMAExYS12s7ddHVr8rNJKoQIwIvlxnT4p4sL+ KLCoKDtPnz/pG0WvvpFe8dozlKiDouNFE45ePnxmov5clTZuQyhJ+wQqvNl2OSJk+0t38U vJBiOyP9NjCG1loPbtq4tSJBOi+gnaI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689347864; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3wuF9bAx8hX6s5r5wVko0LuySvZyQk4HakmL7YtlCqc=; b=c+TeSejnekrKfvzstXrTjMtNhJ+CXyYOoNau9DOvVXW6JKqT85LsK8cMu/ggICBghuQdIc BBiLfEmvEV4NONAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E5CB413A15 for ; Fri, 14 Jul 2023 15:17:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GAR0LxdnsWQtNgAAMHmgww (envelope-from ) for ; Fri, 14 Jul 2023 15:17:43 +0000 Date: Fri, 14 Jul 2023 10:18:19 -0500 From: Goldwyn Rodrigues To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: remove duplicate free_async_extent_pages() on reservation error Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org While performing compressed writes, if the extent reservation fails, the async extent pages are first free'd in the error check for return value ret, and then again at "goto out_free". Remove the first call to free_async_extent_pages(). Signed-off-by: Goldwyn Rodrigues Reviewed-by: Josef Bacik diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index dbbb67293e34..cb742242ce26 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1217,7 +1217,6 @@ static int submit_one_async_extent(struct btrfs_inode *inode, async_extent->compressed_size, 0, *alloc_hint, &ins, 1, 1); if (ret) { - free_async_extent_pages(async_extent); /* * Here we used to try again by going back to non-compressed * path for ENOSPC. But we can't reserve space even for