qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] block: protect BlockBackend->queued_requests with a lock
@ 2023-02-27 20:57 Stefan Hajnoczi
  2023-02-27 20:57 ` [PATCH 1/3] block: make BlockBackend->quiesce_counter atomic Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2023-02-27 20:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Emanuele Giuseppe Esposito, qemu-block, Hanna Reitz, Kevin Wolf,
	Paolo Bonzini, Stefan Hajnoczi

QEMU block layer multi-queue support involves running I/O requests from
multiple threads. Shared state must be protected somehow to avoid thread-safety
issues.

The BlockBackend->queued_requests CoQueue is accessed without a lock and will
likely be corrupted when multiple threads queue requests at the same time.

This patch series make BlockBackend->queued_requests thread-safe.

Stefan Hajnoczi (3):
  block: make BlockBackend->quiesce_counter atomic
  block: make BlockBackend->disable_request_queuing atomic
  block: protect BlockBackend->queued_requests with a lock

 block/block-backend.c | 41 ++++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 11 deletions(-)

-- 
2.39.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-06 21:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 20:57 [PATCH 0/3] block: protect BlockBackend->queued_requests with a lock Stefan Hajnoczi
2023-02-27 20:57 ` [PATCH 1/3] block: make BlockBackend->quiesce_counter atomic Stefan Hajnoczi
2023-03-03 15:29   ` Hanna Czenczek
2023-03-06 21:01     ` Stefan Hajnoczi
2023-02-27 20:57 ` [PATCH 2/3] block: make BlockBackend->disable_request_queuing atomic Stefan Hajnoczi
2023-03-03 15:30   ` Hanna Czenczek
2023-02-27 20:57 ` [PATCH 3/3] block: protect BlockBackend->queued_requests with a lock Stefan Hajnoczi
2023-03-03 15:30   ` Hanna Czenczek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).