Re: [PATCH v2 5/6] blk-mq: fix freeze queue race

From: Tejun Heo
Date: Thu Jul 09 2015 - 17:34:20 EST


On Thu, Jul 02, 2015 at 11:29:56PM +0900, Akinobu Mita wrote:
> There are several race conditions while freezing queue.
...
> Also, percpu_ref_reinit() and percpu_ref_kill() must not be executed
> at the same time. Because both functions could call
> __percpu_ref_switch_to_percpu() which adds the bias value and
> initialize percpu counter.
>
> Fix those races by serializing with per-queue mutex.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> Cc: Jens Axboe <axboe@xxxxxxxxx>
> Cc: Ming Lei <tom.leiming@xxxxxxxxx>

Yeap, all of the kill/reinit/switch mode functions assume caller side
synchronization.

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/