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 39B79803BB for ; Tue, 10 Nov 2026 07:53:12 +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 6AA7pu1H011908; Tue, 10 Nov 2026 10:51:57 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AA7pu1H011908 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="q7a7sW3D" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AA7pk9b011854 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 10 Nov 2026 10:51:46 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AA7pk9b011854 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4915ba023d4so1153413f8f.0 for ; Mon, 09 Nov 2026 23:51:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErF9RRSJE+u92JRIDTDMrZq9fZ5zYGXN2xLFENfcQYRjVk+bkRsvvtXU1JLSo74DKGu0gmsvEA==@openvz.org X-Gm-Message-State: APuU4Z+2m+h5D0i+/iX08MfxzLugRqEqzLI3ClcYO6mtFqdPKoJbCbpR 3VIrliq9JBQTd+xf3onf9ugxS7zOjYUnQ6wW0E0t8wMK1BRoOnY+cFZxChbgUI+b3N6Qesdf7yz nqI3KNv9Sx29M8sP3AloQUit0HhhXVIe1p4q22oe7OpkJr7HotGbZRw== X-Gm-Gg: AYBFou2p5tpaPUQgWYBUjYKZNts2Bk+MOreFtmeSkCmC9HG++saKSFiQY6fuY5EVylI uQ1d0FjUxORjsmWV+U81Y90pkmEQG/lQtoQBCUemga2ESZNq5QshTWQFId+WzUaHBezBVjfULOi L3Eg+qTvP5O11YH+uWHJn3WS0RAEow/6zCYdsgiWAjTcJcwY2MGOkVvTPvFqbtqCwLtWN8uRNEm 3D6wAaPaYiRb9N3vRKuNvTpUfBs3ijGGNP+XCbqeb1ITE7emZCm5hDwDe4jPTqh+JNDTzKw2Qfq g7sCLiXzB1ABChLqAjqXwTL7tbRZI1dlIzELn0jzD5Bbdukx41cbgNTp5iDOSIo1oo1DfDjiBK7 sSxNffdwNOALZ03eYLGAY40ZAc9s= X-Received: by 2002:a05:6000:4281:b0:493:bd29:a6e3 with SMTP id ffacd0b85a97d-4982e82bf66mr3302533f8f.15.1794297105826; Mon, 09 Nov 2026 23:51:45 -0800 (PST) X-Received: by 2002:a05:6000:4281:b0:493:bd29:a6e3 with SMTP id ffacd0b85a97d-4982e82bf66mr3302503f8f.15.1794297105396; Mon, 09 Nov 2026 23:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794297105; cv=none; d=google.com; s=arc-20260327; b=btBtYFnTKrZnUaevAwuwccHz6CJz7eb/Ehgc96RqaargJn22IVRE8Ud1qszyVRfKqv jOau9rKyakGduciE2HMB7zlnZRgAz/5abHqzQ25CT1p4RX7+U2dkP/BQDNoOpM0Ws+JW HIcDH055mPAxasSt8UxjE3FhlWfFKRViBf4PRs0o9rsdzDKk2xvFWlJgvfbFEmbRAmfU 8YvaRHXFbtoELBCEAEjkUq9Ejw3NIwkJs99+zwnCUOHYWhF0huNV0e8F6DYzKzFteX4I qN/EzaDblEZaHJi1GUF+OBWTXqRBgAxbPez0mxk1EZ0wSb36T7ICBCyYa9sZSmA2wowG 1A/Q== 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=mljZGk8UpDXkAhw+ToTIw73rpgNXzXjduVSjorJWk0kKGv77ttv8mma2Pbw5mXdrxv /qOzLda2Z5vjR67smh8XOVQeCRWHyaGatE0YnjZNslW1SyASFv9SLg2z0w/EhbjP7tL/ MJGvIi4XTseAcFBXhjriYKQi1ds6lJlElIhqb6b35jMap/cdmIyFiCuNgo2zd2kIaUdp eUygUHHxZiN2ql74Td7l0GA3HC2TEwDttDBiD+KpnToChpED65nF/UXTvZCdnYa7784p t3p0szvY4LSobmhIy5YDykobD/ewOifYHFAcpaeeWAWiALl7LB3RNvppIv/mQ2fxFa7h a6mg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=q7a7sW3D; 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-4983705916bsi3305467f8f.322.2026.11.09.23.51.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 23:51:45 -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=q7a7sW3D; 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=q7a7sW3Dn5iD 9hhN51IjtSen6AlxwidQ6gMOxn0BMN7j4pkWlSr2Pk4FMUGPkkd9053FpT6JHjTZProPGA+qMUzyv NKL3MjhxiCsxCCIhUR/KNW+9htbEbZ/2c9SH73pMSCyletP85IwzuahtGfMnKzypqhlyEI8XwBjse n+5IvqURXyKyuO0c1p88ffsil4xt2+ujqtO6RfU4FG3xWi9SiLQmGAZn9ftcKt5jn206BB3jo96hq fUq2hPi4QT0+0tGu0Nv2xuxKrFchiSI4eEr9Iesp81iasMUYWhbvU6mOyhN9J4wnSl/RsOumbsGtq uEkapP7zu9sEvRmi5CD8+A==; 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 1xQgZn-008dOX-1q; Tue, 10 Nov 2026 08:51:35 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Tue, 10 Nov 2026 08:51:32 +0100 Message-ID: <20261110075140.1475607-5-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261110075140.1475607-1-alexander.ivanov@virtuozzo.com> References: <20261110075140.1475607-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v12 04/12] 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