[Qemu-devel] [PATCH v3 0/8] qcow2 check improvements

Vladimir Sementsov-Ogievskiy posted 8 patches 5 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181011151623.25702-1-vsementsov@virtuozzo.com
Test docker-clang@ubuntu passed
Test checkpatch passed
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
block/qcow2-refcount.c | 352 ++++++++++++++++++++++++++++++-----------
1 file changed, 264 insertions(+), 88 deletions(-)
[Qemu-devel] [PATCH v3 0/8] qcow2 check improvements
Posted by Vladimir Sementsov-Ogievskiy 5 years, 6 months ago
Hi all!

v3:

01: s/l2_fixed_entries/l2_dirty/
02: add comment, s/>/>=
03: s/BDRV_SECTOR_SIZE/512
04: add Max's r-b
05: new
06-08: mostly rewritten

v2:
02, 06: check bdrv_getlength error return code

v1:

We've faced the following problem: after host fs corruption, vm images
becomes invalid. And which is interesting, starting qemu-img check on
them led to allocating of the whole RAM and then killing qemu-img by
OOM Killer.

This was due to corrupted l2 entries, which referenced clusters far-far
beyond the end of the qcow2 file.
02 is a generic fix for the bug, 01 is unrelated improvement, 03-07 are
additional info and fixing for such corrupted table entries.

Vladimir Sementsov-Ogievskiy (8):
  block/qcow2-refcount: fix check_oflag_copied
  block/qcow2-refcount: avoid eating RAM
  block/qcow2-refcount: check_refcounts_l2: refactor compressed case
  block/qcow2-refcount: check_refcounts_l2: reduce ignored overlaps
  block/qcow2-refcount: check_refcounts_l2: don't count corrupted
    entries
  block/qcow2-refcount: refactor fixing L2 entry
  block/qcow2-refcount: fix out-of-file L1 entries to be zero
  block/qcow2-refcount: fix out-of-file L2 entries

 block/qcow2-refcount.c | 352 ++++++++++++++++++++++++++++++-----------
 1 file changed, 264 insertions(+), 88 deletions(-)

-- 
2.18.0