From patchwork Mon Oct 24 11:27:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp463511wru; Mon, 24 Oct 2022 06:48:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64FoPBZlcrxbpyPAEJewYR2WlQGNzhe6fZuVkhzPh+kRhjslMDpVB2booXKNazVN7Fj35V X-Received: by 2002:a17:907:a47:b0:79e:56dc:5373 with SMTP id be7-20020a1709070a4700b0079e56dc5373mr13172350ejc.148.1666619288038; Mon, 24 Oct 2022 06:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619288; cv=none; d=google.com; s=arc-20160816; b=cRQYqSqtz6eoGLV5e2VNw+xm7kaRd6MyTwjhpOzmT44P3ac8KwmHhQ6OMxk7MlyDbM bKsYHcG7KYdt2+8guAlP7NBj0QXDl6jwaHueMla84tqt5Ou4IoDAD36bapZCzEzoq2Np kapxlGvDlXjJm1Dda+ZydvIqGBPBbriw+eJeTUnLx7ADbRXTd37VYK/NwS1KAQaWlzOz gHz0EX9Z32yww7SKFI+LXYSbCxFhXht9ilujUgegF75hneaPkRrcBvrmgaV7OqwDHZdO sU4DRKIydl31Ol0PMQjf8b0BdCcGe3ZcsnexovWMoxb2pQUfF4mONQEW8tvP62kkkzLW kboQ== 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=SRkLa+PHjuwqeMlzW+sko+2bFyEGk41iXPmRmDIpvfg=; b=zEr0XPYwRg3RTDwsxALf6zz2T95neMwgzKW/nZftheEVtLqTgzDMnzvdlx1WBwdcYb PhZpmXYy8iaRERGuy8mRRWzIeE3t1ZoeyzA+37FzsVvIQLy58+ItiyS6gIo8Tshqk0lH hegFZbv3GijOk/qNATUD2RWk0EiOLLHdWM0x/Wh/JFSW/iwpAS5PUtXNDUCjtemFo1He maQ7SHbkQ0aWMazbH3hOiT6LsDeXcpaQVKMU2poVA9KCVlvvMrF/FOq1GYx/LO/qHCn4 6Ay2veG5KPx8VxxlEbKyG/I9u4wGh3Ehfd5KbEnwUzcsZcqw/yQJP9/Fi9W+LV+hTXfh 2fjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BH+DDR5l; 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 21-20020a170906309500b0078d4b9e68cbsi24685458ejv.1002.2022.10.24.06.47.43; Mon, 24 Oct 2022 06:48:08 -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=BH+DDR5l; 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 S236374AbiJXNqT (ORCPT + 99 others); Mon, 24 Oct 2022 09:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236511AbiJXNoV (ORCPT ); Mon, 24 Oct 2022 09:44:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B006402E1; Mon, 24 Oct 2022 05:40:16 -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 29CE46133A; Mon, 24 Oct 2022 12:38:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C698C433C1; Mon, 24 Oct 2022 12:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615122; bh=AFa8a5sesGuSJSKsd2zWmTwOICUaEhIgr5X8brAl8u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BH+DDR5lAh8vNIlJJJPzuZgQ2lDUh3L55aDZbSBBy6JcydwKhM9cpjN74tZS9bjI1 FDIu1C0R3jFVz4V5K4/nMNXWnJeiQQiIJSLFQnC9Km3EgapL/JQv4aE4OTph5bZPk5 7p/OAKkXPuz1rYMMeGMgNy7/MkgsrMCjY5mL1s5A= 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.15 100/530] ext4: fix miss release buffer head in ext4_fc_write_inode Date: Mon, 24 Oct 2022 13:27:24 +0200 Message-Id: <20221024113049.536381634@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747576986322641857?= X-GMAIL-MSGID: =?utf-8?q?1747576986322641857?= 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 @@ -794,22 +794,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; } /*