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 0FFD31FB4 for ; Fri, 3 Feb 2023 10:21:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D9F9C433EF; Fri, 3 Feb 2023 10:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419712; bh=jmVxCeavWO+FBi8yxOKCkQ7COU927JaLBNSDf/y4n/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kX/xU5n/8gXXuTo7hmcsZAQ8ptyfw8CXlcRVgdA0hXnNNz+kDxfz8uUXRADRSHQAm ifh234xd/4uamCpJuY4EE4Ks8QFLIFndGFkOhZTTgSwlRq1k6AFGvil9181SfcbmAz Bh0lSG9g+I2uibEgabXEzrfNffJjgrGFpyJS58Ko= 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 6.1 13/28] blk-cgroup: fix missing pd_online_fn() while activating policy Date: Fri, 3 Feb 2023 11:13:01 +0100 Message-Id: <20230203101010.534557485@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101009.946745030@linuxfoundation.org> References: <20230203101009.946745030@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 fcf9cf49f5de..7c91d9195da8 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1408,6 +1408,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