Re: [PATCH -next v2 1/2] block, bfq: protect 'bfqd->queued' by 'bfqd->lock'

From: Chaitanya Kulkarni
Date: Fri May 13 2022 - 02:13:14 EST


On 5/12/2022 7:35 PM, Yu Kuai wrote:
> If bfq_schedule_dispatch() is called from bfq_idle_slice_timer_body(),
> then 'bfqd->queued' is read without holding 'bfqd->lock'. This is
> wrong since it can be wrote concurrently.
>
> Fix the problem by holding 'bfqd->lock' in such case.
>
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
> ---

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck