From patchwork Wed Oct 19 08:23:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp204783wrs; Wed, 19 Oct 2022 01:47:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mngDbgdBYpsTOw5FUICaQRVDIgj7AYJJ39hmHFOOX1njn3WBlbmIBC3YVXS73SUIC2Jdz X-Received: by 2002:a62:5a86:0:b0:563:553d:878e with SMTP id o128-20020a625a86000000b00563553d878emr7491231pfb.73.1666169238919; Wed, 19 Oct 2022 01:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169238; cv=none; d=google.com; s=arc-20160816; b=P9aJQH5lhl1t13zhJz2xCmvSEfK9q2d8WX5hv6kBSGki0BPyySm57DrxeFjYvM0YK4 OLVHqS9EZqOap5AzRskZy0Isxfo6kCEjTuWGEEX0oRyUeelJHusqlLeKOjMFtPAnzdHc SXXOZnfxswteBKZQLSK9N9QnZ+gPcxuoMJRB/VbWzGbSvBVRA8Fhk4ByKJt2wcn9p9ZG GNWrHkQpiF4FD1PXG/H2H9vV3zCTreaEzA52hTnZM8OUGvUdXhxDT0+v+cDoOJ1piIxx XNNls1ncpt1vlJsAIv1oQd29e8RbvMdSsBId8u568sFlrRGb2NRAFWmsJMKvsOFS1nkb xXfA== 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=pkxVrs/35vHyYcD1xYVRHwkzyb3L7wnjwIKmJi2O1zhLgcrgCgLkAGEC3ph0qtZXar df8UVyvKyA6Kp+S3TQdjGGHyVGdQFSwOABk9FkhykOaU1Z+sftdq7NYJD5puCFfcJrfZ 1my0MMQwgOP6xpAvb/JwZrKywfHckoxtkUE/F6A01n/XYIcNQBs1rYg2FjlFW8Y3HOsO acODfKVNn/HwhWEz0P4nghXrEFCvpOliAWJfbLy+PPkIOgiMOst2L+FNtJt4ZzsXkbJI YpH49nU23EG/BwDOeNw2XVec8QBg+xXJoceJsKkgz4S3w6SGfaB5lVQdLhgvfycHgrT0 2nAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CuaI1m5K; 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 s19-20020a63f053000000b0044b412c1a77si16568263pgj.362.2022.10.19.01.47.04; Wed, 19 Oct 2022 01:47:18 -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=CuaI1m5K; 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 S231375AbiJSIqu (ORCPT + 99 others); Wed, 19 Oct 2022 04:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbiJSIpI (ORCPT ); Wed, 19 Oct 2022 04:45:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CBA89AE6; Wed, 19 Oct 2022 01:43:52 -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 AAB69617F7; Wed, 19 Oct 2022 08:43:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A6EC433D6; Wed, 19 Oct 2022 08:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169026; bh=uVz+BDY/wMcdakK3a2zAGCIAkzkiJQgDSwU4vNQtw5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CuaI1m5K5mi5qHFqqbHxxKEcs1J3/4NkVbR/rAFUZMCnAkQeBfyQSv9avLbL5hwuj IEWxJ+CT7xalWDTlP2uv6mMDBvoKgjj7MFFGVA1UOOzjjOFB4CO2qICAZPpFwBd+Dq gCALFiWHrHq+4liPub/V6L4U+7P9dzwBSVBkYjDg= 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 133/862] jbd2: add miss release buffer head in fc_do_one_pass() Date: Wed, 19 Oct 2022 10:23:40 +0200 Message-Id: <20221019083255.854394135@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?1747105075669010539?= X-GMAIL-MSGID: =?utf-8?q?1747105075669010539?= 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;