From patchwork Mon Oct 24 11:27:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534826wru; Mon, 24 Oct 2022 09:11:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79bLfkhX7SOotY9jwEzzeNgToDD5WRuw0BxaL56zl/f2tP6drO69/4Rh4kR5MP77RYWyTB X-Received: by 2002:a05:6a00:4192:b0:563:5e95:1db3 with SMTP id ca18-20020a056a00419200b005635e951db3mr34475188pfb.14.1666627909856; Mon, 24 Oct 2022 09:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627909; cv=none; d=google.com; s=arc-20160816; b=arSXTHtar6z+X2DECoT50CdVQ325Qvnv+cWia/XRmBoXj+AkMkYxEBspqJ8ckKChQU j/nx/wuFee3hOQXtMdvFD05u7regV760WpRZ51F7v2i4sSvOH9ToDi9kEDg2bA0fxrh3 OM4MfjsmieGlhOFgVqlkXlFBnnUrEzLmX9qQM9TD0hdQfug6wz2GJn47nNCpv6PUL2db lmGwjj+5n8e0i1VrEQ6NazKLe3O1rZxBq9ijgyrIc9x1E/9eWIO25rXlL2eohgqxOPZP 7qviLQ9GBKktUUH+X3u6vnyujFnh4dBzmpsuPOteIKGiH+BCyh/sG6cZruxq0WHNPqEC WBDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OZaGlkC9BrYC45iEbTf/k4AjzfP59RwUHesCmmtaaRE=; b=AxkcJf7xyv68Fwbiwo3Xc6z7314dBfCGmlhAH55vZUIAS/SyN9wvZSNrG6TZsinMho G51hZN8OWmbE4XIiBcRGXZmZEJD/GZTdhGOPd+UH+aUCsImFhN7KaMMxkqBA+g1KW4+X JE1cyFRDX4IAtiq8uBcLt/bmx0JREfC+TTne9q1WmwdtvHq9phHj79HCZBO0vVZHYn8g f4eG3lzEu9mZ5en2hqgcb7tTO3W2qcPIyHneRUJQtD7wBrLeiGt2/qUEpdnXaKfwfnqx X6d/f8kDlQfQrdNrfgRSqmIqGl0Vs4pj16CI0wJWzSjFgpRDQwnANcXel+3S48kP8SEu LOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PylAocf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020a63e916000000b003fea0415b5asi37620758pgh.834.2022.10.24.09.11.33; Mon, 24 Oct 2022 09:11:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PylAocf4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbiJXQK5 (ORCPT + 99 others); Mon, 24 Oct 2022 12:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233308AbiJXQE1 (ORCPT ); Mon, 24 Oct 2022 12:04:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90C8A11DAAD; Mon, 24 Oct 2022 07:56: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 ams.source.kernel.org (Postfix) with ESMTPS id 884F7B81628; Mon, 24 Oct 2022 12:18:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D57A2C433D6; Mon, 24 Oct 2022 12:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613929; bh=m3P8wj85nmlYhKsgy0AO2VM9B2JZ7cdOZOIryw76RFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PylAocf4SMHS9doyQtmq/mYotgGuq9o1P8LshmgPvh9B3xzVMHlM5iz4fyZkohzRV 0FVsjxnTNLElW65cCEdZEUN6yW9AkXa3jf6Wz/vk2m6OwRhjVXnqbLQyuxAOOzGfOV COOIGcUYXKdp2e2i4sP/L00PVwxsq+Uu6XhHhIyE= 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 5.10 067/390] ext4: fix miss release buffer head in ext4_fc_write_inode Date: Mon, 24 Oct 2022 13:27:44 +0200 Message-Id: <20221024113025.457319106@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747586027137470719?= X-GMAIL-MSGID: =?utf-8?q?1747586027137470719?= 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 @@ -766,22 +766,25 @@ static int ext4_fc_write_inode(struct in tl.fc_tag = cpu_to_le16(EXT4_FC_TAG_INODE); tl.fc_len = cpu_to_le16(inode_len + sizeof(fc_inode.fc_ino)); + ret = -ECANCELED; dst = ext4_fc_reserve_space(inode->i_sb, sizeof(tl) + inode_len + sizeof(fc_inode.fc_ino), crc); if (!dst) - return -ECANCELED; + goto err; if (!ext4_fc_memcpy(inode->i_sb, dst, &tl, sizeof(tl), crc)) - return -ECANCELED; + goto err; dst += sizeof(tl); if (!ext4_fc_memcpy(inode->i_sb, dst, &fc_inode, sizeof(fc_inode), crc)) - return -ECANCELED; + goto err; dst += 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 = 0; +err: + brelse(iloc.bh); + return ret; } /*