From patchwork Sat Oct 22 07:20:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1089517wrr; Sat, 22 Oct 2022 00:43:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7natU0oESq8YGgm8AreDbedbX5qnDF8AvObCj+2UMj7TCtwL5iYzGfGURxWQomr2upMXEN X-Received: by 2002:a17:90a:5915:b0:20a:d6d5:31bd with SMTP id k21-20020a17090a591500b0020ad6d531bdmr26530268pji.15.1666424603024; Sat, 22 Oct 2022 00:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424603; cv=none; d=google.com; s=arc-20160816; b=q8w6wjVDhpCNnpn5Hw5dBZchai3NvZbOIieavmNzWXdCDyiUf4B3lCFxOcJJ7ExQjo ReOGCnREJr9+h/OPx6t2dKW2YVYAzMNHKMWPAy5xPzVJxhf4q8dbKTyhoLVu4rdQ5B3+ iER/yydhomK5yV5A9nYiwU+KEexcmRVdoKlmtgeU8o4Aajw708oJLX62benfDpWEeU+v 0DGwpkjiTlKBDPKj2FgUudD9+N6i3xFFZ1tEe5M4xJw+hI7tEUljK960stdA57mCxmSV f6qSK8uwKgTQe5CDvhBT9bICpDu4ZU2C0a0V3GBt2lhmIUDuozIrknddurw/KyGIUoTy C4YQ== 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=J+VM+zBZxb3Vn8CGSa1yNCzIUpKgdkvXVHvjiENLezo=; b=Vl2RN7bNoC5z48v7PPNxS+lhH0LCQEbT2lYQhxtZDcox2HnQuOAlBh6zhQPtslt3zD Qq4gHEhrG0eDjdfhiKdPsRz8BaDMGwoGQp1WHfFKBPlurdEa2w5mDCSc380WBQYz/Alg h+w9ZFrCW4No0Lu9d8PQgr7ypa0TrQkqQYZJzEMOLxXlDwrlLhznNmVfVKcosGamROdc yVYwH+bMy48q43sb4jT5rVixfMuDXjypdetL6Kjh5Zm9WiRf9HegYO/XxVArnqoH4ct6 gWr/OaxJga+rRUlulZ0Tcnvj+SYgqGaCefdWdD6a7Sgdv8FsuVPC58QQxpwjSaJ5dsKf xyHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rRS426XH; 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 ob15-20020a17090b390f00b00205b268cd58si2354835pjb.181.2022.10.22.00.43.11; Sat, 22 Oct 2022 00:43: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=rRS426XH; 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 S230513AbiJVHmn (ORCPT + 99 others); Sat, 22 Oct 2022 03:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbiJVHl5 (ORCPT ); Sat, 22 Oct 2022 03:41:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B8C15ECD8; Sat, 22 Oct 2022 00:40:39 -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 D9F4FB82E04; Sat, 22 Oct 2022 07:39:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C188C433D6; Sat, 22 Oct 2022 07:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424372; bh=uVz+BDY/wMcdakK3a2zAGCIAkzkiJQgDSwU4vNQtw5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rRS426XHt2OZLw+Vi0xjGY+iRYU91EzEPTe5eFFuwtyRuw0PrYRcX4jaTdXq1SNyx hGkgys9Pd7HprdR3t8fd7bibipCftX4MD4fbg6Di0X9WAhIMIT9lo1vIhDrq03W/1J oTRLTRHL/ceWzsuDUp0q4QIQ4DQ2CFT1dc2Ars60= 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 121/717] jbd2: add miss release buffer head in fc_do_one_pass() Date: Sat, 22 Oct 2022 09:20:00 +0200 Message-Id: <20221022072436.918799318@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?1747372844165058871?= X-GMAIL-MSGID: =?utf-8?q?1747372844165058871?= From: Ye Bin commit dfff66f30f66b9524b661f311bbed8ff3d2ca49f upstream. In fc_do_one_pass() miss release buffer head after use which will lead to reference count leak. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220917093805.1782845-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/recovery.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c @@ -256,6 +256,7 @@ static int fc_do_one_pass(journal_t *jou err = journal->j_fc_replay_callback(journal, bh, pass, next_fc_block - journal->j_fc_first, expected_commit_id); + brelse(bh); next_fc_block++; if (err < 0 || err == JBD2_FC_REPLAY_STOP) break;