From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 3B7208017D for ; Mon, 9 Nov 2026 14:03:30 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A9E2Cxj032564; Mon, 9 Nov 2026 17:02:13 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9E2Cxj032564 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="s3yF+lyL" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A9E1lxY032501 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 9 Nov 2026 17:01:48 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9E1lxY032501 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48e1d839ddaso626158f8f.3 for ; Mon, 09 Nov 2026 06:01:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFeQsuF5fqQpmEvItJQaDYs8ZXBvLQxAMXqwpL3/WD4sczgVuFk6rCoxhWDFAIDPpaFPc9Zxw==@openvz.org X-Gm-Message-State: APuU4Z+F08FcpDzZVJfqVDOLdRYUxaWmsmSoc30a2v912xcsYNlDPgrL ucgEAcGQEXwvckVIHAatX9RCbSeXXtBvrW5wgBQqVgTwOmJOwYG1sGmR6qAZjOZQjE9GDnNdLq0 k4+nQNmm6/P2wb/XdKcaFLTSONqM4nPLr3GIRi1cXUy4Lp2oLgzjN1g== X-Gm-Gg: AYBFou1T9mfka/FoGdCs0eX7UfCtp+XMEf7iQ7zC5Q0jmA051BWvqPgoj2pMoCDLbsy ZxFiQF3T23cf8ju+p2NVi6tjxlp017kVJ18rWtWZP+V0dfykH5qTl9yv37UNgklkVBLvybNdTGD xIHTj+BYWQ/4+q3m9n2oN3N0WN2QgamEzTrTMgB96Ylwn1c+hMNHjTFaACaH2X8AH39Z7b8d+uL hUl31IUR+FiuNBz+rLKyU9dN4B+g9cksQMVFcs4XFl4cEykxj6MmT4QqaAIyH5AxbwjNdO4lVSA VyMKLhEuIvb5ekbHwaUxqOuhJuSEB4Ar1P0Cy6fZicqYM0/iQHETPPy+qkDvr99fZK1MXMYKYyv VSDGRgXGZDzuUfH+/O0ijpC+tm74= X-Received: by 2002:a05:6000:248a:b0:48e:6357:c76d with SMTP id ffacd0b85a97d-495889fed20mr7718466f8f.21.1794232907219; Mon, 09 Nov 2026 06:01:47 -0800 (PST) X-Received: by 2002:a05:6000:248a:b0:48e:6357:c76d with SMTP id ffacd0b85a97d-495889fed20mr7718390f8f.21.1794232906606; Mon, 09 Nov 2026 06:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794232906; cv=none; d=google.com; s=arc-20260327; b=kBzBPAoKC0NYrWNFC1nUQYUYZHIgj69fw/1yQVoJwxazoJR0l7CBLJUc9PhXP3YRPz 2x+B9CZ0TQ4kRmTwf6zv6ih3XDJ8ckwH1X+m40mhYg1FWwbYyya3jaAwgiGyC/E9x+xD DvTkqdu+wm253C6/zDSNsWvQ+c8NNK1VKtlsRJFQos2eKSGhi6WzS28stuR9AgBmQjy7 KdQ8Pk1RmGU+RLfbFYp4nZ/HZtudGSYNjvwkfpjT6DeRU8CWo4Uh+vrosOuZtQ+xzo50 iwoZUBUhqkdwubO9H7BTx89bMnqhAByevrO2oxyTe5cZIGJPlFKGkXs8wVbt8yQSOp7H 42EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aERaFX+YA2hQtpNIwhlcO7B7rNAELv3rW4sgB9+PZbU=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=V89k3NXTpmYOmrUwtvOhh8UHwhqvrypW1v+9OduWFEPIebll0Aabl3kvH2jEW9Rx6i DwId1DBQg5O8ipS7f/V5iyLwidqrJHsqrJTfzQd5+Fq63yo5de/PHl1m/z1iAQfIQJqQ +jssCKo+5DdjhugV80m9IBve9sNSbX+hoZwYQBeHTkax1sjMIxrTOFcj67CEcLkvNO3R RJTWyPUP1ejyOjHChjt0iZFlsj5pKByPXMJJ68YiQsjly9tQ/p0GEthk1Ept/3jAAA+u eu3e7HtXiuGFpofemCxKEJw5693DbzdP5eL64AjDzIuPCmFzrjzbN7GrOTQR66XiE5f2 coyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=s3yF+lyL; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-49596bc3af5si9117103f8f.87.2026.11.09.06.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 06:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=s3yF+lyL; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=aERaFX+YA2hQtpNIwhlcO7B7rNAELv3rW4sgB9+PZbU=; b=s3yF+lyLCw6n DvDwKkryD3kTfsQGflVzqXN7ymjlLBwemANrfsfYhL1pZ3vTcNoMRTH1piWAMkyh8FPxJ0+K0pxjf SN2ghPH4B8gV/6cw7VhR47hMOzsY6vVAJef8w4YBQHuq5kUu75yfdr4nHUvGxSlzARDm0gxFJsY7P 4g0x2oxjAV5LzDKMJJN/9kWfSHGk64fTjCXhxDO+jXV8wivcbklnO/Y+rQsOUL+GjVDWY0g2cIXwZ tRC6s/PvVY4j4EJbrFBX3D1D6TEYOsgYk2/Uo6sQ35vGaA2tQBta//y+f9gkWPbfvKk7DrVmDR73X SGsPEBt1Yt5GN60EKzitgw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xQPsL-005vFF-2j; Mon, 09 Nov 2026 15:01:37 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Mon, 9 Nov 2026 15:01:37 +0100 Message-ID: <20261109140143.1408038-5-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261109140143.1408038-1-alexander.ivanov@virtuozzo.com> References: <20261109140143.1408038-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v11 04/10] dm-qcow2: complete wbd before ending the data qio X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org data_rw_complete() calls qio_endio() before complete_wbd(). qio_endio() drops the inflight ref, so qcow2_flush_deferred_activity() may return on suspend while complete_wbd() for a failed L1/L2 writeback is still running in AIO completion context. revert_l_entries_update() then marks clusters unused and dirties an R2 page after the flush. That page sits on slow_wb_batch_list with the slow writeback timer armed. If the timer fires first, the page is written while the device is suspended, after postsuspend has cleared the dirty bit. If preresume comes first, qcow2_free_md_pages_all() frees the page without taking it off the list, and the timer later walks freed memory. Complete the wbd first, so the R2 update is in place before the inflight ref goes away and the suspend flush writes it back. The md writeback path already does it in this order. https://virtuozzo.atlassian.net/browse/VSTOR-148171 Feature: dm-qcow2: block device over QCOW2 files driver Fixes: 222b6f1291c1c ("dm-qcow2: Introduce driver to create block devices over QCOW2 files") Signed-off-by: Alexander Ivanov --- drivers/md/dm-qcow2-map.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c index e8a41954c4c6..7866c791325b 100644 --- a/drivers/md/dm-qcow2-map.c +++ b/drivers/md/dm-qcow2-map.c @@ -2892,13 +2892,14 @@ static void data_rw_complete(struct qio *qio) spin_unlock_irqrestore(&qcow2->md_pages_lock, flags); } + /* qio_endio() drops the inflight ref, which suspend waits for */ + if (finalize_wbd) + complete_wbd(qcow2, wbd); if (call_endio) { if (bi_status != BLK_STS_OK) qio->bi_status = bi_status; qio_endio(qio); } - if (finalize_wbd) - complete_wbd(qcow2, wbd); } static void perform_rw_mapped(struct qcow2_map *map, struct qio *qio) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel