From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F818C63797 for ; Fri, 3 Feb 2023 10:22:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233407AbjBCKWh (ORCPT ); Fri, 3 Feb 2023 05:22:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbjBCKWd (ORCPT ); Fri, 3 Feb 2023 05:22:33 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D739C305E6 for ; Fri, 3 Feb 2023 02:22:13 -0800 (PST) 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 sin.source.kernel.org (Postfix) with ESMTPS id 8B633CE2FB9 for ; Fri, 3 Feb 2023 10:21:54 +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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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