Re: [PATCH v4 0/4] blk-cgroup: fix blkg list and policy data races
From: Nilay Shroff
Date: Mon Aug 03 2026 - 02:57:13 EST
On 8/2/26 4:55 PM, Yu Kuai wrote:
From: Yu Kuai <yukuai@xxxxxxx>
This set fix some problems that are reported long time ago with minimal changes,
the blkcg_mutex refactor I'm working on can fix these problems as well, but it's
complicated and may not land in this merge window. So I think this set should land
in this merge window first.
Patch 1 protects blkg_destroy_all()'s q->blkg_list walk with
blkcg_mutex.
Patches 2-3 fix races between blkcg_activate_policy() and concurrent
blkg destruction.
Patch 4 factors the policy data teardown loop into a helper after the
race fixes.
This series looks good to me, however as I recall, we discussed about
protecting blkg_create() as well using ->blkcg_mutex. I remember the
blkg_create() is not protected with ->blkcg_mutex under each call path,
so would you to also cover that change in this patchset?
Thanks,
--Nilay