Skip to content

virtio_blk: use synchronous quiesce in virtblk_freeze_priv() - #1286

Open
blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1162215=>linus-master
Open

blktests-ci-kpd[bot] wants to merge 1 commit into
linus-master_basefrom
series/1162215=>linus-master

Conversation

@blktests-ci-kpd

Copy link
Copy Markdown

Pull request for series with
subject: virtio_blk: use synchronous quiesce in virtblk_freeze_priv()
version: 1
url: https://patchwork.kernel.org/series/1162215/

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1162215/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 50d05c7
series: https://patchwork.kernel.org/series/1162215/
version: 1

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1162215/
version: 1

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 72e4775 to 3cc6c21 Compare September 12, 2026 02:40
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5225b8e
series: https://patchwork.kernel.org/series/1163426/
version: 2

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1163426/
version: 2

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 2f0c1cf
series: https://patchwork.kernel.org/series/1163426/
version: 2

@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 5878583
series: https://patchwork.kernel.org/series/1163426/
version: 2

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from b102a54 to cf27a35 Compare September 15, 2026 09:35
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 551c722
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 538cc63 to 2c3d876 Compare October 1, 2026 15:24
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: ce1e022
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 2c3d876 to 2518147 Compare October 1, 2026 23:23
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: e767a4e
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 2518147 to 5cbbe68 Compare October 3, 2026 09:40
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: a74306e
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 5cbbe68 to 34cdc8d Compare October 3, 2026 22:01
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: None
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 34cdc8d to dd6ddf6 Compare October 5, 2026 02:08
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 22430ae
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from dd6ddf6 to 0e201a3 Compare October 6, 2026 13:16
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 69f80fe
series: https://patchwork.kernel.org/series/1175208/
version: 3

@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 0e201a3 to 6a6c6c1 Compare October 6, 2026 17:29
@blktests-ci-kpd

Copy link
Copy Markdown
Author

Upstream branch: 7b63ef2
series: https://patchwork.kernel.org/series/1175208/
version: 3

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>
@blktests-ci-kpd
blktests-ci-kpd Bot force-pushed the series/1162215=>linus-master branch from 6a6c6c1 to 567aeff Compare October 7, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants