[Devel] [PATCH hci-8.2 3/3] ms/mm/damon/core: handle region split failure in apply_min_nr_regions()

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 23 07:35:58 MSK 2026


> From: SJ Park <sj at kernel.org>
> 
> damon_apply_min_nr_regions() repeatedly split each region until its size
> becomes small enough to meet the user-defined low limit of the number of
> regions.  The loop assumes the split operation (damon_split_region_at())
> will always succeed and create the new region.  But the operation could
> silently fail for memory allocation failures, for example.
> 
> If such failure happens and the region was the last region, the linked
> list-based next region fetching returns invalid pointer.  As a result,
> invalid memory dereference and corruption could happen.  Even if the
> corner case is handled, it imposes stress to the allocator by trying split
> regions for other targets.  Fix the issue by breaking all the loops for
> any region split failure.
> 
> [ ... ]
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-156361
> Feature: fix ms/mm
> 
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261123042846.1684796-1-eva.kurchatova@virtuozzo.com?part=3




More information about the Devel mailing list