From 8b128e37b774769b73c781f11205148c8de792f5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 11 Mar 2023 10:34:39 +0100 Subject: [PATCH] Revert "blk-cgroup: dropping parent refcount after pd_free_fn() is done" This reverts commit 7fe33a6f21b3f5435079c7a1980bc27dce6ec995 which is commit c16df11b4e1124573dbfb91cc45e4afc8b0324a0 upstream. It is reported to cause problems, as only 2 of the 3 patch series were applied to the stable branches. Reported-by: Mike Cloaked Reported-by: Eric Biggers Cc: Yu Kuai Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jens Axboe Cc: Sasha Levin Link: https://bugzilla.kernel.org/show_bug.cgi?id=217174 Link: https://lore.kernel.org/r/ZAuPkCn49urWBN5P@sol.localdomain Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- block/blk-cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 8d1b7757f1e4f..7c91d9195da8d 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -93,8 +93,6 @@ static void blkg_free_workfn(struct work_struct *work) if (blkg->pd[i]) blkcg_policy[i]->pd_free_fn(blkg->pd[i]); - if (blkg->parent) - blkg_put(blkg->parent); if (blkg->q) blk_put_queue(blkg->q); free_percpu(blkg->iostat_cpu); @@ -129,6 +127,8 @@ static void __blkg_release(struct rcu_head *rcu) /* release the blkcg and parent blkg refs this blkg has been holding */ css_put(&blkg->blkcg->css); + if (blkg->parent) + blkg_put(blkg->parent); blkg_free(blkg); } -- 2.39.5