From patchwork Sat Oct 22 07:20:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1090282wrr; Sat, 22 Oct 2022 00:46:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7rNRzMHdWuVq6H3wL1fcOr8yIymxgs5W56EYZxuIjSZgA9BNwo57vz7GSoAuAcfFR/rN9s X-Received: by 2002:a17:902:e552:b0:179:e795:71c5 with SMTP id n18-20020a170902e55200b00179e79571c5mr23018062plf.57.1666424783932; Sat, 22 Oct 2022 00:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424783; cv=none; d=google.com; s=arc-20160816; b=LILxiWU7x3lC733UpmkUvAgpzeQExvACpL2Fq49wb1ORzSW5RL7FQYryhqLYngKWhZ 2l1dGdf3f4imrcnKgrsxg3iLO422bvt4d8cCdmjKpnoR2dlJWJk2/P9sFNKvAM1Jbh4P 6AGEOmO/d+x2S2ddYOmq8NakYPG9PMJBvellWM9bjQ8F+pgIcwL08kWmlSBiNnKoUAvu Zd3tK0EbzEQXKAdOh19TZCg2I+lTinb8Yca2hbtiwtEGahkNlO24Gh8nvcksQNlje1xT xj2Q+JFUt3xJ/JwPpzvdF3nu22gW9so2uKpVAOC5O9M55Si0oMbYEBQJGICZScHcenHu 4DUQ== 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=U9rzKormMlT8leH8LAAQxWwGQPYSDsvBAJ4mHm9d0TE=; b=wIA8zdokj9CAYn7lB0HNX7oSuAdj9Ekopx2BwvQu3EpwFVKHMhiZkGAoSkjBGmd4ZG Lqg2W5NVM97IFZ/Kf3Ee502Fdn2EuCuyn2dPpfYHEnNcTAqp/w+b3Aqj9fSNbPU9WFwa gIXCd94OnM5YVPhVK3W5XkxdC1gRHILv807LtD+GNWx7Yov5wUWkhDu0NWetix6N3vI9 znIRbU0afwpjkHdQPeu7M4BHdPglpmPDGFJPlL8CTJIAVJKBgB6PUwOHnU20mnIPqwul A8sjo0/Cv7xNCpnvZw5PYE1h39NAkjzLULTZsDMn+ZW5OAZlsAv991jVhkJGqlId1PLH sGMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1vjdEjvQ; 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 i186-20020a626dc3000000b0053e67522538si25615979pfc.331.2022.10.22.00.46.11; Sat, 22 Oct 2022 00:46:23 -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=1vjdEjvQ; 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 S231359AbiJVHp5 (ORCPT + 99 others); Sat, 22 Oct 2022 03:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbiJVHoF (ORCPT ); Sat, 22 Oct 2022 03:44:05 -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 267B163D35; Sat, 22 Oct 2022 00:42:36 -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 7F817B82E0E; Sat, 22 Oct 2022 07:41:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0EB7C433D6; Sat, 22 Oct 2022 07:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424485; bh=C620LoJ1iYClQH8UWros1PqqPG0tOj5qGlc2syb/41g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1vjdEjvQbJr8fEg79OAL/tVahuG6j+uUHIH6JvGnv9qQCcB367ASIvkaoj1ELospn MLcofFC6PduVzk3Go5XjY3FAt0XVfhVkXPhNf2NXSukY6VuQvOuAyRlrjH2rOxlPmd Hom3c40R7FIJXhck9b+lGgQsyKk5sW4KEHSkgBBM= 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.19 133/717] ext4: fix miss release buffer head in ext4_fc_write_inode Date: Sat, 22 Oct 2022 09:20:12 +0200 Message-Id: <20221022072439.057846523@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373034573595608?= X-GMAIL-MSGID: =?utf-8?q?1747373034573595608?= 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 = 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; } /*