QEMU disks have the werror/rerror policies: on an I/O error either
report it to the guest, or pause the VM and retry the request on
resume. A vhost-blk disk completes requests to the guest from the
kernel, so QEMU never sees the error. This series lets dm-qcow2 hold
a failed request according to the policy, tell QEMU about it, and
retry or fail it on request from userspace.

Patches 1-2 fix the existing ENOSPC delay: a use-after-free of the
event work and timer on destroy, and a suspend stalled by a request
delayed while the timer callback runs.

Patches 3-4 rename the ENOSPC delay list to a held request list and
arm the retry timer once per hold, so new failures do not postpone
the retry of the held requests forever.

Patch 5 sends an IO_ERROR change uevent when requests get held, as
QEMU cannot wait for dm events without CAP_SYS_ADMIN.

Patch 6 adds the resubmit and fail_held messages, so libvirt can
retry the held requests on VM resume and drop them on VM destroy.

Patch 7 adds the error_policy=<read>,<write> table argument with the
report, enospc and stop policies. The default keeps the current
behaviour for writes.

Patch 8 requeues held requests to the dm queue on a noflush suspend,
so a table reload or a snapshot of a paused VM does not deliver the
error to the guest.

Patch 9 fixes a vhost-blk hang on release when the vhost worker was
killed with I/O in flight, which a VM destroyed while its requests
are held runs into.

https://virtuozzo.atlassian.net/browse/VSTOR-152175

Alexander Ivanov (9):
  drivers/md/dm-qcow2: cancel the event work and ENOSPC timer in the
    destructor
  drivers/md/dm-qcow2: always resubmit delayed ENOSPC requests in
    presuspend
  drivers/md/dm-qcow2: rename the ENOSPC delay list to a held request
    list
  drivers/md/dm-qcow2: arm the hold timer only for the first held
    request
  drivers/md/dm-qcow2: report held requests with an IO_ERROR uevent
  drivers/md/dm-qcow2: add the resubmit and fail_held messages
  drivers/md/dm-qcow2: add the error_policy table argument
  drivers/md/dm-qcow2: requeue held requests on a noflush suspend
  drivers/vhost/blk: fix a hang on release after the vhost worker is
    killed

 drivers/md/dm-push-backup.c  |   2 +-
 drivers/md/dm-qcow2-cmd.c    |  32 +++++++++-
 drivers/md/dm-qcow2-map.c    | 110 +++++++++++++++++++++++++++++------
 drivers/md/dm-qcow2-target.c | 104 ++++++++++++++++++++++++++++-----
 drivers/md/dm-qcow2.h        |  26 +++++++--
 drivers/md/dm-rq.c           |   4 +-
 drivers/md/dm-rq.h           |   2 +-
 drivers/vhost/blk.c          |  52 ++++++++++++-----
 8 files changed, 274 insertions(+), 58 deletions(-)

-- 
2.53.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to