All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: andrey.zhadchenko@virtuozzo.com,
	Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v7 5/6] dm-qcow2: keep the dirty bit of an image opened dirty
Date: Thu, 22 Oct 2026 14:58:36 +0000	[thread overview]
Message-ID: <010701a1641f041e-82a0602b-cf5c-49ae-8e0e-65e1b7c77936-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261022145032.2128679-6-alexander.ivanov@virtuozzo.com>

> With kernel_sets_dirty_bit, postsuspend clears the dirty bit
> unconditionally. An image that is dirty at open, e.g. after a crash,
> has unrepaired refcounts, which may be below real usage, yet it is
> marked clean on disk after the first suspend. A userspace check before
> the next open then has no reason to repair it.
> 
> Clear the bit only if the image was clean before the kernel set it.
> The parsed header can't tell this: it is reread on every preresume and
> may carry the kernel's own bit, e.g. on the lower image of a backward
> merge cancelled by suspend in waiting_completion or of a merge with
> depth > 0. So track two flags per image: kernel_dirty_bit is set only
> while the last header write was a successful set and the reread header
> still has the bit, opened_dirty is set when the header has the bit and
> kernel_dirty_bit is not set. Clearing the bit of an image opened dirty
> is left to userspace check.
> 
> After a failed write the bit found on disk is taken as opened dirty,
> which costs an extra check, rather than as the kernel's, which could
> clear a bit set by userspace while the device was suspended.
> 
> This only preserves the on-disk marker. The driver still accepts a
> dirty image read-write and allocates from its refcounts, so
> find_unused_cluster() may hand out clusters that L2 still references
> until the image is checked.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-148171
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261022145032.2128679-1-alexander.ivanov@virtuozzo.com?part=5


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-22 14:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 14:50 [Devel] [PATCH hci-8.1 v7 0/6] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 1/6] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
2026-10-22 14:55   ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 2/6] dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages Alexander Ivanov
2026-10-22 14:53   ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 3/6] dm-qcow2: extend the file in place_r2() before linking the refblock Alexander Ivanov
2026-10-22 14:56   ` no-reply
2026-10-26 10:52   ` Andrey Zhadchenko
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 4/6] dm-qcow2: complete wbd before ending the data qio Alexander Ivanov
2026-10-22 14:58   ` no-reply
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 5/6] dm-qcow2: keep the dirty bit of an image opened dirty Alexander Ivanov
2026-10-22 14:58   ` no-reply [this message]
2026-10-22 14:50 ` [Devel] [PATCH hci-8.1 v7 6/6] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-22 15:02   ` no-reply
2026-10-23  6:40     ` Alexander Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a1641f041e-82a0602b-cf5c-49ae-8e0e-65e1b7c77936-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.