From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8901C001B0 for ; Sun, 16 Jul 2023 20:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231927AbjGPUYv (ORCPT ); Sun, 16 Jul 2023 16:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231905AbjGPUYu (ORCPT ); Sun, 16 Jul 2023 16:24:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13275126 for ; Sun, 16 Jul 2023 13:24:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A677160EB0 for ; Sun, 16 Jul 2023 20:24:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B72C2C433C7; Sun, 16 Jul 2023 20:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689539089; bh=jCGXrgC9uocQPlJ9eyEqeHh082rRqrlK1w1eIj/JJeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nAnlpbD0hg+FGalAtgJj5sncZUOlelXz2FXykjvHmgsFrlL8kxnfXBpepOAJIW6/O 4A9q8FctrKD1xJSPuxdIGFvy0auF1KuRKE8aIHd9ZvKu4D8OuaCimhPGDCpKiN11po 0ccBIXJ2NyC9Khlc4LKrJodRUpmgczWkPqvxrKCE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.4 683/800] f2fs: fix error path handling in truncate_dnode() Date: Sun, 16 Jul 2023 21:48:56 +0200 Message-ID: <20230716195004.988785348@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230716194949.099592437@linuxfoundation.org> References: <20230716194949.099592437@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chao Yu [ Upstream commit 0135c482fa97e2fd8245cb462784112a00ed1211 ] If truncate_node() fails in truncate_dnode(), it missed to call f2fs_put_page(), fix it. Fixes: 7735730d39d7 ("f2fs: fix to propagate error from __get_meta_page()") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 834c6f099c955..6bdb1bed29ec9 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -943,8 +943,10 @@ static int truncate_dnode(struct dnode_of_data *dn) dn->ofs_in_node = 0; f2fs_truncate_data_blocks(dn); err = truncate_node(dn); - if (err) + if (err) { + f2fs_put_page(page, 1); return err; + } return 1; } -- 2.39.2