From patchwork Wed Oct 19 08:23:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp223869wrs; Wed, 19 Oct 2022 02:38:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6y2BU07MXU02h8LiOEEQ95IeP2oMLdul3jmD31Hs7Mi2DLHnPOpHI0Q9tJq8jYP2t0nSaN X-Received: by 2002:a17:907:3d8f:b0:78d:b46e:eadd with SMTP id he15-20020a1709073d8f00b0078db46eeaddmr6070109ejc.277.1666172324230; Wed, 19 Oct 2022 02:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172324; cv=none; d=google.com; s=arc-20160816; b=bbq4rb9zAKa3oprAq0VCjR91SHZHBseyLtRrex6aDNrHgiLAwEi0HCww8c3JojvnGG mOhIHPLZy0eWJ4x2lzbO7FHpbjWFGOVjZ4EOs6TmVBqiAlNKPQyEtuV52PEbgVT6QrqV ZDTVCr5PE8ai0YjlVW3pk8T4CElBPWkVeoRdAaHtcikEQHoYqUBqtKDdt7/Tt4mpPCA1 1yTSZoMxrvo5VHklp0W6M/h4Sqnaj0U9SbkHUzpkjd7LejHKem97dkHGZrreCPe7Wwl4 gZUmAz9UfoA7mxWtaLC0n1oCb+13WA5BLctiOaia24zxQLHCX5jfxPuHRQl16esGQ0hi Gddg== 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=PfMhVL/dgtlWoigC94gXIAf73/VODj7J+ftOSOTMQrCJoGYjWuSkrtQQTmD/V/P6uN Mkbtzmq0Tc8oVlnsa2chFpY+4Kd+spS22+D+oVPlSgA+LA4k8QMcz1hs1W+pG5nKHWeB 3OkPe4ha6a/yrjS3GSWb7VCubI7JROPSasaRwSQBEVmFi3ICQqZFadH5NabvVzZpzUWp UyOYOSRBMGQM5R/6xw/pGSn20FIAsijaOPVA5NNQl2Peod+SJo8h0iU6aaT/BKW5wNgx w/v2iLvEQovLfSuXWlZDdZ9yLRg2H3Ct+zRFha3RG+2F+Nus+ALnXSOQBtaCY5ACI1Jn oP2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qHIuVl85; 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 gs42-20020a1709072d2a00b0078dad42f75dsi14870011ejc.475.2022.10.19.02.38.19; Wed, 19 Oct 2022 02:38:44 -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=qHIuVl85; 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 S233625AbiJSJ2B (ORCPT + 99 others); Wed, 19 Oct 2022 05:28:01 -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 X-Spam-Status: No, score=-7.4 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?1747108310644659315?= X-GMAIL-MSGID: =?utf-8?q?1747108310644659315?= 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; } /*