fix potential data loss in QEMU (missed flush)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 6 repliesIn review
Changes from the cover letter
* added patches 1 & 2
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | block: create bdrv_advance_flush_gen() helperblock/ include/ | +6 | 1 reply | |
| 2/3 | block: move bdrv_advance_flush_gen() earlier from bdrv_co_write_req_finishblock/ | +13 | 2 replies | |
| 3/3 | qcow2: add very final sync on QCOW2 image closingblock/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] fix potential data loss in QEMU (missed flush)
This series is a followup to my previous patch sent under "qcow2: add very final sync on QCOW2 image closing". Could be considered as v2.
This series addresses two problems:
1. bdrv_co_flush() at the end of bdrv_driver_pwritev() and bdrv_co_do_pwrite_zeroes() could be effectively no op. The problem is that bdrv_co_flush() is optimized internally this way to track real requests which were making changes in the image and without such requests from previous flush() do nothing. Requests are tracked using write_gen on BDS. This field should be incremented after write is completed but before flush is called.
This could be considered as potential data loss if caller relies on BDRV_REQ_FUA flag which means that such requests are really lands on the underlying device, which could not due to missed flush().
2. qcow2_update_header() must actually write header with BDRV_REQ_FUA flag as image processing on open relies on the fact that header is actual and it is not possible to reorder header modifications and image content modifications.
Changes:
* added patches 1 & 2