[Devel] [PATCH hci-8.1 2/2] ms/blk-throttle: fix throtl_data leak during disk release

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 2 19:58:01 MSK 2026


> From: Yu Kuai <yukuai3 at huawei.com>
> 
> Tightening the throttle activation check in blk_throtl_activated() to
> require both q->td presence and policy bit set introduced a memory leak
> during disk release:
> 
> blkg_destroy_all() clears the policy bit first during queue deactivation,
> causing subsequent blk_throtl_exit() to skip throtl_data cleanup when
> blk_throtl_activated() fails policy check.
> 
> Idealy we should avoid modifying blk_throtl_exit() activation check because
> it's intuitive that blk-throtl start from blk_throtl_init() and end in
> blk_throtl_exit(). However, call blk_throtl_exit() before
> blkg_destroy_all() will make a long term deadlock problem easier to
> trigger[1], hence fix this problem by checking if q->td is NULL from
> [ ... ]
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-152993
> Feature: fix ms/block
> 
> Signed-off-by: Denis V. Lunev <den at openvz.org>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261102161219.3735623-1-den@openvz.org?part=2




More information about the Devel mailing list