Skip to content

qcow2: fix parallel rewrite and discard

Vladimir Sementsov-Ogievskiy qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iotests: add qcow2-discard-during-rewritetests/qemu-iotests/tests/qcow2-discard-during-rewrite tests/qemu-iotests/tests/qcow2-discard-during-rewrite.out+93 -00 replies
2/2block/qcow2: introduce inflight writes counters: fix discardblock/qcow2-refcount.c block/qcow2.c block/qcow2.h +1 more+186 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/2] qcow2: fix parallel rewrite and discard

Hi all! It occurs that nothing prevents discarding and reallocating host cluster during data writing. This way data writing will pollute another flash allocated cluster of data or metadata.

Here is my suggestion to fix it basing on improved refcounts model. Look at 02 for details.

I don't insist on this version, and will soon send a v2, based on CoRwLock, as Kevin suggested, which should look simpler. Still, with v1 we keep possibility of relatively async discard.. Doesn't seem worth the complexity.. But I'd like to share my idea of additional "runtime" reference counters for clusters, as it may be needed later if we face problems with more restrictive CoRwLock or may be for some other task. So here is it.

Vladimir Sementsov-Ogievskiy (2):
iotests: add qcow2-discard-during-rewrite block/qcow2: introduce inflight writes counters: fix discard

 block/qcow2.h                                 |   9 +
 block/qcow2-refcount.c                        | 154 +++++++++++++++++-
 block/qcow2.c                                 |  26 ++-
 .../tests/qcow2-discard-during-rewrite        |  72 ++++++++
 .../tests/qcow2-discard-during-rewrite.out    |  21 +++
 5 files changed, 278 insertions(+), 4 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/qcow2-discard-during-rewrite
 create mode 100644 tests/qemu-iotests/tests/qcow2-discard-during-rewrite.out
Signature · 1 line
2.29.2