[Devel] [PATCH hci-8.2 v2 5/8] dm-qcow2: fix qcow2_flush_deferred_activity() skipping a running timer

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 23 18:45:38 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-qcow2: Fixes tag names the driver import, not the
  ENOSPC-retry commit
--

commit 70d283a3940a99a583c3b5dc1637d001646c9370
Author: Denis V. Lunev <den at openvz.org>

> dm-qcow2: fix qcow2_flush_deferred_activity() skipping a running timer
>
> qcow2_flush_deferred_activity() runs the slow writeback timer callback
> itself in each of its two passes, so that dirty R1/R2 pages are
> written, but skips that when timer_delete_sync_try() finds the callback
> running on another CPU. A callback skipped in the first pass is over by
> the second, as the inflight reference switch in between waits for an
> RCU grace period. The timer can however be rearmed by an R1/R2 page
> that the first pass failed to write with ENOSPC, and expire just as the
> second pass starts. That callback queues the worker after the last
> flush_workqueue(), so the pages are written after the flush returns:
> after suspend has cleared the dirty bit of the image, or, at backward
> merge complete, on an image that is already freed.
>
> Wait for the callback with timer_delete_sync() and then run it
> unconditionally. Every caller can sleep and none holds md_pages_lock.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-156036
>
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den at openvz.org>

[Severity: Low]
The race described in the message needs a timer rearm by an R1/R2 page that failed with ENOSPC, and that rearm comes from 8805ee1133a5 ("dm-qcow2: retry R1/R2 writeback that failed with ENOSPC"). That commit added the retry in clear_writeback_status() and the two-pass md_wb_no_retry logic in qcow2_flush_deferred_activity(). Without it, nothing rearms the timer between the two passes. Should the tag point there instead?

  Fixes: 8805ee1133a5 ("dm-qcow2: retry R1/R2 writeback that failed with ENOSPC")

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261123153640.128227-1-den@openvz.org?part=5



More information about the Devel mailing list