All of lore.kernel.org
 help / color / mirror / Atom feed
* (in guest) disk corruption during snapshots
@ 2026-02-03 14:25 Jean-Louis Dupond
  2026-02-05  8:59 ` Fiona Ebner
  0 siblings, 1 reply; 9+ messages in thread
From: Jean-Louis Dupond @ 2026-02-03 14:25 UTC (permalink / raw)
  To: qemu-devel, f.ebner, kwolf; +Cc: dionbosschieter

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

Hi,

Since some months we were observing disk corruption within the VM when 
enabling backups (which triggers snapshots).
After a lot of troubleshooting, we were able to track down the commit 
that caused it:
https://gitlab.com/qemu-project/qemu/-/commit/058cfca5645a9ed7cb2bdb77d15f2eacaf343694

More info in the issue:
https://gitlab.com/qemu-project/qemu/-/issues/3273

Now this seems to be caused by a race between disabling the 
dirty_bitmaps and the tracking implemented in the mirror top layer.
Kevin shared me a possible solution:

diff --git a/block/mirror.c b/block/mirror.c
index b344182c747..f76e43f22c1 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1122,6 +1122,9 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
       * accessing it.
       */
      mirror_top_opaque->job = s;
+    if (s->copy_mode != MIRROR_COPY_MODE_WRITE_BLOCKING) {
+        bdrv_disable_dirty_bitmap(s->dirty_bitmap);
+    }
  
      assert(!s->dbi);
      s->dbi = bdrv_dirty_iter_new(s->dirty_bitmap);
@@ -2018,7 +2021,9 @@ static BlockJob *mirror_start_job(
       * The dirty bitmap is set by bdrv_mirror_top_do_write() when not in active
       * mode.
       */
-    bdrv_disable_dirty_bitmap(s->dirty_bitmap);
+    if (s->copy_mode == MIRROR_COPY_MODE_WRITE_BLOCKING) {
+        bdrv_disable_dirty_bitmap(s->dirty_bitmap);
+    }
  
      bdrv_graph_wrlock_drained();
      ret = block_job_add_bdrv(&s->common, "source", bs, 0,


Running this for some hours already, and it seems to fix the issue.

Let's open up the discussion if this is the proper way to fix it, or if 
there are better alternatives :)

Thanks
Jean-Louis

[-- Attachment #2: Type: text/html, Size: 2700 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-16 10:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 14:25 (in guest) disk corruption during snapshots Jean-Louis Dupond
2026-02-05  8:59 ` Fiona Ebner
2026-02-05  9:29   ` Kevin Wolf
2026-02-05 10:45     ` Fiona Ebner
2026-02-05 16:27       ` Kevin Wolf
2026-02-09 11:42         ` Fiona Ebner
2026-02-10 21:19           ` Kevin Wolf
2026-02-12  9:55             ` Fiona Ebner
2026-02-16 10:07               ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.