Commit 7f597c2
dm: fix queue start/stop imbalance under suspend/load/resume races
When suspend and load run concurrently, before q->mq_ops is set in
blk_mq_init_allocated_queue(), __dm_suspend() skip dm_stop_queue(). As a
result, the queue's quiesce depth is not incremented.
Later, once table load has finished and __dm_resume() runs, which triggers
q->quiesce_depth ==0 warning in blk_mq_unquiesce_queue():
Call Trace:
<TASK>
dm_start_queue+0x16/0x20 [dm_mod]
__dm_resume+0xac/0xb0 [dm_mod]
dm_resume+0x12d/0x150 [dm_mod]
do_resume+0x2c2/0x420 [dm_mod]
dev_suspend+0x30/0x130 [dm_mod]
ctl_ioctl+0x402/0x570 [dm_mod]
dm_ctl_ioctl+0x23/0x30 [dm_mod]
Fix this by explicitly tracking whether the request queue was
stopped in __dm_suspend() via a new DMF_QUEUE_STOPPED flag.
Only call dm_start_queue() in __dm_resume() if the queue was
actually stopped.
Fixes: e70feb8 ("blk-mq: support concurrent queue quiesce/unquiesce")
Cc: stable@vger.kernel.org
Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>1 parent 1d57628 commit 7f597c2
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2960 | 2960 | | |
2961 | 2961 | | |
2962 | 2962 | | |
2963 | | - | |
| 2963 | + | |
2964 | 2964 | | |
| 2965 | + | |
| 2966 | + | |
2965 | 2967 | | |
2966 | 2968 | | |
2967 | 2969 | | |
| |||
2983 | 2985 | | |
2984 | 2986 | | |
2985 | 2987 | | |
2986 | | - | |
| 2988 | + | |
2987 | 2989 | | |
2988 | 2990 | | |
2989 | 2991 | | |
| |||
3067 | 3069 | | |
3068 | 3070 | | |
3069 | 3071 | | |
3070 | | - | |
| 3072 | + | |
3071 | 3073 | | |
3072 | 3074 | | |
3073 | 3075 | | |
| |||
0 commit comments