Re: [PATCH] block, bfq: initialize active lists for all actuators

From: Damien Le Moal

Date: Wed Oct 07 2026 - 03:11:11 EST


On 2026/10/05 12:41, lirongqing wrote:
> From: Li RongQing <lirongqing@xxxxxxxxx>
>
> Commit 2d31c684a053 ("block, bfq: inject I/O to underutilized
> actuators") extended bfqd->active_list from a single list_head to an
> array indexed by actuator, but bfq_init_queue() still only initialized
> the first two entries:
>
> INIT_LIST_HEAD(&bfqd->active_list[0]);
> INIT_LIST_HEAD(&bfqd->active_list[1]);
>
> For devices with more than two independent access ranges, the remaining
> list heads stay zeroed by kzalloc() and are never set up as empty lists.
> When BFQ later adds a bfq_queue to one of those lists, list_add() writes
> through head->next, which is NULL, corrupting the list or crashing the
> kernel.
>
> Initialize every actuator's active list using bfqd->num_actuators,
> which is already set up earlier in bfq_init_queue().
>
> Fixes: 2d31c684a053 ("block, bfq: inject I/O to underutilized actuators")
> Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>

Looks OK to me.

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>


--
Damien Le Moal
Western Digital Research