blockjobs: Fix transactional race condition
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest11 patches 38 repliesIn review
- v15 patches 8 repliesSuperseded
Changes in v2 from the cover letter
- Lots of differences in patches 2-9.
- Cancel should now work on an "unstarted" blockjob.
- New refactoring patches.
- Added "start" property for BlockJob Drivers.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | blockjob: fix dead pointer in txn listblockjob.c | +1 | 1 reply | |
| 2/11 | blockjob: centralize QMP event emissionsblockdev.c blockjob.c | +20 | 13 replies | |
| 3/11 | Blockjobs: Internalize user_pause logicblock/ blockdev.c blockjob.c +1 more | +27 | 3 replies | |
| 4/11 | blockjobs: Always use block_job_get_aio_contextblock/ blockdev.c blockjob.c +2 more | +15 | 5 replies | |
| 5/11 | blockjobs: split interface into public/privateblock/ block/ block/ +9 more | +368 | 2 replies | |
| 6/11 | blockjobs: fix documentationinclude/ | +3 | 2 replies | |
| 7/11 | blockjob: add .clean propertyblock/ blockjob.c include/ | +19 | 1 reply | |
| 8/11 | blockjob: add .start fieldblock/ block/ block/ +2 more | +22 | 0 replies | |
| 9/11 | blockjob: add block_job_startblock/ block/ block/ +4 more | +54 | 3 replies | |
| 10/11 | blockjob: refactor backup_start as backup_job_createblock/ block/ blockdev.c +1 more | +86 | 6 replies | |
| 11/11 | iotests: add transactional failure race testtests/ tests/ | +93 | 2 replies |
Reviews trailers per patch
1 of 11 patches has a Reviewed-by or Acked-by.
| Patch | John Snow | Eric Blake | Kevin Wolf |
|---|---|---|---|
| 1/11 | T-b R-b | R-b | R-b |
| 2/11 | |||
| 3/11 | |||
| 4/11 | |||
| 5/11 | |||
| 6/11 | |||
| 7/11 | |||
| 8/11 | |||
| 9/11 | |||
| 10/11 | |||
| 11/11 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [Qemu-devel] [PATCH v2 00/11] blockjobs: Fix transactional race condition
There are a few problems with transactional job completion right now.
First, if jobs complete so quickly they complete before remaining jobs get a chance to join the transaction, the completion mode can leave well known state and the QLIST can get corrupted and the transactional jobs can complete in batches or phases instead of all together.
Second, if two or more jobs defer to the main loop at roughly the same time, it's possible for one job's cleanup to directly invoke the other job's cleanup from within the same thread, leading to a situation that will deadlock the entire transaction.
Thanks to Vladimir for pointing out these modes of failure.
This series also does a little digging into refactoring Jobs into public and private interfaces. It's somewhat unrelated, but it was easier to include this with this series than separate it out and send it later. This comprises patches 2-6. The actual fixes here are in patches 1 and 7-10. A new test to catch Vladimir's failure scenario is in patch 11.
v2:
- Lots of differences in patches 2-9.
- Cancel should now work on an "unstarted" blockjob.
- New refactoring patches.
- Added "start" property for BlockJob Drivers.
________________________________________________________________________________
For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch job-manual-start
https://github.com/jnsnow/qemu/tree/job-manual-start
This version is tagged job-manual-start-v2:
https://github.com/jnsnow/qemu/releases/tag/job-manual-start-v2
John Snow (10):
blockjob: centralize QMP event emissions
Blockjobs: Internalize user_pause logic
blockjobs: Always use block_job_get_aio_context
blockjobs: split interface into public/private
blockjobs: fix documentation
blockjob: add .clean property
blockjob: add .start field
blockjob: add block_job_start
blockjob: refactor backup_start as backup_job_create
iotests: add transactional failure race test
Vladimir Sementsov-Ogievskiy (1):
blockjob: fix dead pointer in txn list
block/backup.c | 59 ++++--- block/commit.c | 6 +- block/io.c | 6 +- block/mirror.c | 7 +- block/replication.c | 13 +- block/stream.c | 6 +- blockdev.c | 128 +++++++-------- blockjob.c | 72 +++++++-- include/block/block.h | 3 +- include/block/block_int.h | 29 ++-- include/block/blockjob.h | 345 +++------------------------------------- include/block/blockjob_int.h | 366 +++++++++++++++++++++++++++++++++++++++++++ qemu-img.c | 4 +- tests/qemu-iotests/124 | 91 +++++++++++ tests/qemu-iotests/124.out | 4 +- tests/test-blockjob-txn.c | 14 +- tests/test-blockjob.c | 2 +- 17 files changed, 688 insertions(+), 467 deletions(-) create mode 100644 include/block/blockjob_int.h
Signature · 1 line
2.7.4