From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6191FB9 for ; Fri, 3 Feb 2023 10:29:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C659FC433D2; Fri, 3 Feb 2023 10:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675420198; bh=6IPvLjmhgSXxnwws/KoW+dUYQVKEQRL1CCrrjuWAOiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGF8BZU+ZoPHJ9vbtHwCvfv4F9a6ZT02yawjzuDoGtWhVeMk8khrIfX+tmx6zNMOs yWJu/X7uaQxgCAm2Gq/v56GSKezBC9stBJr73rBzHIZoJrWiFZHaV8dznsQITDrnXT YC8udo3g+WLbq/FlJTNO4r9sw6LPjt7f25Jmh+Kw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yu Kuai , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 5.4 112/134] blk-cgroup: fix missing pd_online_fn() while activating policy Date: Fri, 3 Feb 2023 11:13:37 +0100 Message-Id: <20230203101028.869720807@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101023.832083974@linuxfoundation.org> References: <20230203101023.832083974@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Yu Kuai [ Upstream commit e3ff8887e7db757360f97634e0d6f4b8e27a8c46 ] If the policy defines pd_online_fn(), it should be called after pd_init_fn(), like blkg_create(). Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230103112833.2013432-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-cgroup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index dde8d0acfb34..cd085a0e5e4a 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1445,6 +1445,10 @@ int blkcg_activate_policy(struct request_queue *q, list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) pol->pd_init_fn(blkg->pd[pol->plid]); + if (pol->pd_online_fn) + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) + pol->pd_online_fn(blkg->pd[pol->plid]); + __set_bit(pol->plid, q->blkcg_pols); ret = 0; -- 2.39.0