From nobody Fri Oct 17 10:32:13 2025 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 68159C4332F for ; Wed, 19 Oct 2022 09:28:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233626AbiJSJ2D (ORCPT ); Wed, 19 Oct 2022 05:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbiJSJ0d (ORCPT ); Wed, 19 Oct 2022 05:26:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C2AE4C20; Wed, 19 Oct 2022 02:11:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 738BE617D7; Wed, 19 Oct 2022 08:44:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F2FC433C1; Wed, 19 Oct 2022 08:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169063; bh=C620LoJ1iYClQH8UWros1PqqPG0tOj5qGlc2syb/41g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qHIuVl85tP3VWCd4c1MuBl7GmOIOtcu05okyAiC913082K+ZVwT0Zi6/385PYAD43 lgJMqLdVaPfqIxZJ0tWpe3vFu1jbsqOCU8Pn0nEnD20k0GEyZjnXN/RB7WyLqKrx5J VDwNQi+eHIGMkg9jzKsH3Lt0YCx78UXZGyCH2Zjw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Ye Bin , Jan Kara , Theodore Tso Subject: [PATCH 6.0 145/862] ext4: fix miss release buffer head in ext4_fc_write_inode Date: Wed, 19 Oct 2022 10:23:52 +0200 Message-Id: <20221019083256.394645446@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Ye Bin commit ccbf8eeb39f2ff00b54726a2b20b35d788c4ecb5 upstream. In 'ext4_fc_write_inode' function first call 'ext4_get_inode_loc' get 'iloc= ', after use it miss release 'iloc.bh'. So just release 'iloc.bh' before 'ext4_fc_write_inode' return. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220914100859.1415196-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/fast_commit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -874,22 +874,25 @@ static int ext4_fc_write_inode(struct in tl.fc_tag =3D cpu_to_le16(EXT4_FC_TAG_INODE); tl.fc_len =3D cpu_to_le16(inode_len + sizeof(fc_inode.fc_ino)); =20 + ret =3D -ECANCELED; dst =3D ext4_fc_reserve_space(inode->i_sb, sizeof(tl) + inode_len + sizeof(fc_inode.fc_ino), crc); if (!dst) - return -ECANCELED; + goto err; =20 if (!ext4_fc_memcpy(inode->i_sb, dst, &tl, sizeof(tl), crc)) - return -ECANCELED; + goto err; dst +=3D sizeof(tl); if (!ext4_fc_memcpy(inode->i_sb, dst, &fc_inode, sizeof(fc_inode), crc)) - return -ECANCELED; + goto err; dst +=3D sizeof(fc_inode); if (!ext4_fc_memcpy(inode->i_sb, dst, (u8 *)ext4_raw_inode(&iloc), inode_len, crc)) - return -ECANCELED; - - return 0; + goto err; + ret =3D 0; +err: + brelse(iloc.bh); + return ret; } =20 /*