Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755599AbdCKDsr (ORCPT ); Fri, 10 Mar 2017 22:48:47 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:4292 "EHLO dggrg01-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933425AbdCKDsi (ORCPT ); Fri, 10 Mar 2017 22:48:38 -0500 From: Zhou Chengming To: CC: , , , Subject: [PATCH v3] don't forget to call pd_online_fn when activate policy Date: Sat, 11 Mar 2017 11:46:20 +0800 Message-ID: <1489203980-46134-1-git-send-email-zhouchengming1@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.58C37391.0030,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b7b96cdf8631ae2b43c9113011680f86 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 808 Lines: 28 When we activate policy on the request_queue, we will create policy_date for all the existing blkgs of the request_queue, so we should call pd_init_fn() and pd_online_fn() on these newly created policy_data. Signed-off-by: Zhou Chengming --- block/blk-cgroup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 8ba0af7..1eba1d2 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1254,6 +1254,12 @@ int blkcg_activate_policy(struct request_queue *q, pd->plid = pol->plid; if (pol->pd_init_fn) pol->pd_init_fn(pd); + + if (pol->pd_online_fn) { + spin_lock(&blkg->blkcg->lock); + pol->pd_online_fn(pd); + spin_unlock(&blkg->blkcg->lock); + } } __set_bit(pol->plid, q->blkcg_pols); -- 1.8.3.1