Repository navigation
virtio_blk: use synchronous quiesce in virtblk_freeze_priv() - #1286
blktests-ci-kpd[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: 50d05c7 |
|
Upstream branch: 50d05c7 |
bd2df17 to
72e4775
Compare
7efd8cd to
a0aeca9
Compare
|
Upstream branch: 5225b8e |
72e4775 to
3cc6c21
Compare
|
Upstream branch: 5225b8e |
3cc6c21 to
3591f20
Compare
a0aeca9 to
772381e
Compare
|
Upstream branch: 2f0c1cf |
3591f20 to
b7ddbb9
Compare
772381e to
0224dee
Compare
|
Upstream branch: 2f0c1cf |
b7ddbb9 to
b102a54
Compare
0224dee to
f14340f
Compare
|
Upstream branch: 5878583 |
b102a54 to
cf27a35
Compare
f14340f to
0e174bc
Compare
c6537fe to
eebb5bc
Compare
|
Upstream branch: 551c722 |
538cc63 to
2c3d876
Compare
eebb5bc to
bbd3af0
Compare
|
Upstream branch: ce1e022 |
2c3d876 to
2518147
Compare
bbd3af0 to
a9c0b46
Compare
|
Upstream branch: e767a4e |
2518147 to
5cbbe68
Compare
a9c0b46 to
72d0f5e
Compare
|
Upstream branch: a74306e |
5cbbe68 to
34cdc8d
Compare
72d0f5e to
d980ad5
Compare
|
Upstream branch: None |
34cdc8d to
dd6ddf6
Compare
d980ad5 to
83b99cc
Compare
|
Upstream branch: 22430ae |
dd6ddf6 to
0e201a3
Compare
83b99cc to
9081535
Compare
|
Upstream branch: 69f80fe |
0e201a3 to
6a6c6c1
Compare
9081535 to
6118c5c
Compare
|
Upstream branch: 7b63ef2 |
blk_mq_run_work_fn() can call blk_mq_sched_dispatch_requests() through blk_mq_run_dispatch_ops(). The dispatcher checks QUEUE_FLAG_QUIESCED while the flag is clear. It can then be preempted before it gets a request. At that time, it has no queue usage reference, so blk_mq_freeze_queue() does not wait for it. virtblk_freeze_priv() then calls blk_mq_quiesce_queue_nowait() and blk_mq_unfreeze_queue(). A new request can enter the queue. The old dispatcher can run again, use its old flag check, get the new request, and call virtio_queue_rq(). At the same time, virtblk_freeze_priv() can reset the device, delete the virtqueues, and free vblk->vqs. The old dispatcher can then use a deleted virtqueue or a NULL vblk->vqs, and the kernel can crash. Fix this by using blk_mq_quiesce_queue(), which waits for dispatch code that was already running. Keep the existing freeze and unfreeze order. The queue remains quiesced until virtblk_restore_priv() calls blk_mq_unquiesce_queue(). Fixes: 7678abe ("virtio-blk: don't keep queue frozen during system suspend") Cc: stable@vger.kernel.org Acked-by: Jason Wang <jasowangio@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Cong Zhang <cong.zhang@oss.qualcomm.com>
6a6c6c1 to
567aeff
Compare
Pull request for series with
subject: virtio_blk: use synchronous quiesce in virtblk_freeze_priv()
version: 1
url: https://patchwork.kernel.org/series/1162215/