From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B1D11ED38 for ; Tue, 25 Jul 2023 11:23:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5361C433C8; Tue, 25 Jul 2023 11:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690284182; bh=Aoa5szMq1qa8uxXWvcq+6C+lXXGuHcSSnSavM4OJwzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xcs1YQIQMrbVKY9zw7667/Q8bH4W+Nn+mkplGZLBmlQI3SD3hXF+dm3B+UGTlWKkp 7KVNqkJ7PBHNYsOYUXv9weJFUhgVWAA5gUQW1TkBedTAn2QKE0u6S6QAhgcVV6t74u +HdLPK19gNvSz0dp4v0JcRRaXgsAsZ6jl0sTU598= 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 5.10 265/509] f2fs: fix error path handling in truncate_dnode() Date: Tue, 25 Jul 2023 12:43:24 +0200 Message-ID: <20230725104605.890966857@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104553.588743331@linuxfoundation.org> References: <20230725104553.588743331@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 c63274d4b74b0..02cb1c806c3ed 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -884,8 +884,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