pve-qemu/debian/patches/pve
Fiona Ebner 0cffb504e7 backup: create jobs in a drained section
With the drive-backup QMP command, upstream QEMU uses a drained
section for the source drive when creating the backup job. Do the same
here to avoid subtle bugs.

There, the drained section extends until after the job is started, but
this cannot be done here for multi-disk backups (could at most start
the first job). The important thing is that the cbw
(copy-before-write) node is in place and the bcs (block-copy-state)
bitmap is initialized, which both happen during job creation (ensured
by the "block/backup: move bcs bitmap initialization to job creation"
PVE patch).

One such bug is one reported in the community forum [0], where using a
drive with iothread can lead to an overlapping block-copy request and
consequently an assertion failure. The block-copy code relies on the
bcs bitmap to determine if a request for a certain range can be
created. Each time a request is created, it resets the bcs bitmap at
that range to indicate that it's being handled.

The duplicate request can happen as follows:
Thread A attaches the cbw node
Thread B creates a request and resets the bitmap at that range
Thread A clears the bitmap and merges it with the PBS bitmap
The merging can lead to the bitmap being set again at the range of
the previous request, so the block-copy code thinks it's fine to
create a request there.
Thread B creates another requests at an overlapping range before the
other request is finished.

The drained section ensures that nothing else can interfere with the
bcs bitmap between attaching the copy-before-write block node and
initialization of the bitmap.

[0]: https://forum.proxmox.com/threads/133149/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-09-06 16:59:12 +02:00
..
0001-PVE-Config-block-file-change-locking-default-to-off.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0002-PVE-Config-Adjust-network-script-path-to-etc-kvm.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0004-PVE-Config-ui-spice-default-to-pve-certificates.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0005-PVE-Config-glusterfs-no-default-logfile-if-daemonize.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0006-PVE-Config-rbd-block-rbd-disable-rbd_cache_writethro.patch update submodule and patches to QEMU 8.0.0 2023-05-22 15:09:14 +02:00
0007-PVE-Up-glusterfs-allow-partial-reads.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0008-PVE-Up-qemu-img-return-success-on-info-without-snaps.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0009-PVE-Up-qemu-img-dd-add-osize-and-read-from-to-stdin-.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0010-PVE-Up-qemu-img-dd-add-isize-parameter.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0011-PVE-Up-qemu-img-dd-add-n-skip_create.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0012-qemu-img-dd-add-l-option-for-loading-a-snapshot.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0013-PVE-virtio-balloon-improve-query-balloon.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0014-PVE-qapi-modify-query-machines.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0015-PVE-qapi-modify-spice-query.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0016-PVE-add-IOChannel-implementation-for-savevm-async.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0017-PVE-add-savevm-async-for-background-state-snapshots.patch refresh patch context 2023-08-16 11:50:08 +02:00
0018-PVE-add-optional-buffer-size-to-QEMUFile.patch refresh patch context 2023-08-16 11:50:08 +02:00
0019-PVE-block-add-the-zeroinit-block-driver-filter.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0020-PVE-Add-dummy-id-command-line-parameter.patch regenerate patches 2023-06-15 13:55:22 +02:00
0021-PVE-Config-Revert-target-i386-disable-LINT0-after-re.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0022-PVE-Up-Config-file-posix-make-locking-optiono-on-cre.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0023-PVE-monitor-disable-oob-capability.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0024-PVE-Compat-4.0-used-balloon-qemu-4-0-config-size-fal.patch regenerate patches 2023-06-15 13:55:22 +02:00
0025-PVE-Allow-version-code-in-machine-type.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0026-block-backup-move-bcs-bitmap-initialization-to-job-c.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0027-PVE-Backup-add-vma-backup-format-code.patch regenerate patch stats 2023-09-06 16:59:12 +02:00
0028-PVE-Backup-add-backup-dump-block-driver.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0029-PVE-Add-sequential-job-transaction-support.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch backup: create jobs in a drained section 2023-09-06 16:59:12 +02:00
0031-PVE-Backup-pbs-restore-new-command-to-restore-from-p.patch regenerate patches 2023-06-15 13:55:22 +02:00
0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch regenerate patches 2023-06-15 13:55:22 +02:00
0033-PVE-redirect-stderr-to-journal-when-daemonized.patch regenerate patches 2023-06-15 13:55:22 +02:00
0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch backup: create jobs in a drained section 2023-09-06 16:59:12 +02:00
0035-migration-block-dirty-bitmap-migrate-other-bitmaps-e.patch add patch fixing resume for snapshot and hibernate with drive with iothread and a dirty bitmap 2023-07-28 12:00:50 +02:00
0036-PVE-fall-back-to-open-iscsi-initiatorname.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0037-PVE-block-stream-increase-chunk-size.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0038-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0039-block-add-alloc-track-driver.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0040-Revert-block-rbd-workaround-for-ceph-issue-53784.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0041-Revert-block-rbd-fix-handling-of-holes-in-.bdrv_co_b.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0042-Revert-block-rbd-implement-bdrv_co_block_status.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0043-alloc-track-fix-deadlock-during-drop.patch drop patch for custom get_link_status QMP command 2023-06-07 19:35:40 +02:00
0044-migration-for-snapshots-hold-the-BQL-during-setup-ca.patch add patch fixing resume for snapshot and hibernate with drive with iothread and a dirty bitmap 2023-07-28 12:00:50 +02:00
0045-savevm-async-don-t-hold-BQL-during-setup.patch refresh patch context 2023-08-16 11:50:08 +02:00