# Re: \[PATCH V3 0/2\] block: fix race between adding wbt and normal IO

- From: Ming Lei \<hidden\>
- Date: 2021-06-14 21:55:50 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/06/6403368
- Thread: https://ratatoskr.run/linux-block/2021/06/6403250/t.md

```text
On Wed, Jun 09, 2021 at 09:58:20AM +0800, Ming Lei wrote:
> Hello,
> 
> Yi reported several kernel panics on:
> 
> [16687.001777] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
> ...
> [16687.163549] pc : __rq_qos_track+0x38/0x60
> 
> or
> 
> [  997.690455] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
> ...
> [  997.850347] pc : __rq_qos_done+0x2c/0x50
> 
> Turns out it is caused by race between adding wbt and normal IO.
> 
> Fix the issue by freezing request queue when adding/deleting rq qos.
> 
> V3:
> 	- use ->queue_lock for protecting concurrent adding/deleting rqos on
> 	  same queue
> 
> V2:
> 	- switch to the approach of freezing queue, which is more generic
> 	  than V1.
> 
> 
> 
> Ming Lei (2):
>   block: fix race between adding/removing rq qos and normal IO
>   block: mark queue init done at the end of blk_register_queue
> 
>  block/blk-rq-qos.h | 24 ++++++++++++++++++++++++
>  block/blk-sysfs.c  | 29 +++++++++++++++--------------
>  2 files changed, 39 insertions(+), 14 deletions(-)
> 
> Cc: Yi Zhang <redacted>
> Cc: Bart Van Assche <bvanassche@acm.org>

Hello Jens,

Any chance to merge the fixes if you are fine?

Thanks,
Ming

```
