Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751234AbdCICYV (ORCPT ); Wed, 8 Mar 2017 21:24:21 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3847 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750741AbdCICYU (ORCPT ); Wed, 8 Mar 2017 21:24:20 -0500 From: Zhou Chengming To: CC: , , , Subject: [PATCH v2] don't forget to call pd_online_fn when activate policy Date: Thu, 9 Mar 2017 10:20:08 +0800 Message-ID: <1489026008-161611-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.0A020203.58C0BC51.026E,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: 67f6a76411fc3b8c6771dc013ce50687 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 806 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..0dd9e76 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