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 8AF038017D for ; Mon, 9 Nov 2026 12:00:37 +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 6A9BxQOK031385; Mon, 9 Nov 2026 14:59:27 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9BxQOK031385 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Co7ZV0yR" 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 6A9Bx349031312 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 9 Nov 2026 14:59:03 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9Bx349031312 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48e0af48c18so637916f8f.2 for ; Mon, 09 Nov 2026 03:59:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErGO66varlnGwEqJD/l+SFaAar7xiftJds+gy30S2seLjDsd0aabCP73beoPRQItjHkiJRtq5w==@openvz.org X-Gm-Message-State: APuU4Z+sfSkIgIPsaM/nLtVsdumF5ttjFBsSRh2/Goh2hYeUbJOVkUoU Hb6Wtf1QMzK6GssZerkKtwIipUIyeiQQK1fqRnh+VvTH70xUly2KC8jeSlN4rBiSzsmeAF3a6Yh G+6zzr49EbyugN27OwGFPzVDWf+5MJMGfjWS5/RBf7wDuYo/MsSx5yw== X-Gm-Gg: AYBFou3PFw7gEFN1TVYm5V74kHO7xNHShQVT+Gk6mAaGYeQrygltFp+y7DiNurBZXLA NCfQYDFZZuSdoIh8Pci3JZq/hqvZ8t7YyjzYo7p3WUiIAUJz3b5FiM/92SI+DWMjP0t459vTlcw LZiRrcxe62LPkFGf/hJ6xHLsBBnGWDQ+38gBdfeGNqdLAivPjhLbVT2EDrC8L5Y2i9oUPCe/lv7 mn3hGvVNpR+7PESud1pf4DyTUoOd8Mzu1Q6jeERdTW87RvwkpiNkxnIA6l/JMIJ6DqsQ+EDgmwg +vxrMKjHNhyvyG+WN84k5xQJZZG75hQHvG0OkOlxBvmySHoPdT9BCvT3MNsXpbb9+pyUERl7a1e Qu5NigKq6QpZCv99Ajxct9YtN3Vc= X-Received: by 2002:a05:6000:2dc9:b0:48b:1c:d6e1 with SMTP id ffacd0b85a97d-4958c9653ccmr7478302f8f.43.1794225542898; Mon, 09 Nov 2026 03:59:02 -0800 (PST) X-Received: by 2002:a05:6000:2dc9:b0:48b:1c:d6e1 with SMTP id ffacd0b85a97d-4958c9653ccmr7478273f8f.43.1794225542443; Mon, 09 Nov 2026 03:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794225542; cv=none; d=google.com; s=arc-20260327; b=L99OepEGDoFeIdDdsQOXoA7pRw90dW/2Q+jLAM7LlGWUXAfRnZ64Pba7cXWzWhuyMK yMLiWh21Z0SzR3SocYl6W9tDmD5rMSNEVXD+2L2qGDT1VVA4pC3OeKPIFUk7Ih07dWcT bG/jWNPdl4Kbdtr12fDWGdrLd1MO8DVPL0wyg+NsbgEixU3IPsFXyO4iS5epEBo6mTt5 rjB4NCh7f5HAleqTGDzZM1pj1ZVx61yx3VyeFYPZvvVXn+8n+GfcBdCES2rPf4uqC1bZ qFRO/Yv3j7Fdy/2R03uprbuStuVzTqcWZOKFsNFj6AadS4HL7ReS0YPFz0klfDCRTVrF c+Lg== 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=I3pnd8o2OrNxwRxTkWElI5qpYgw0MXuGmwZFEdIvrIXDLxUaCauhzzJOHGYeSTlbyA IAhbtRx9Ek5CYLjZBkTGSH5xfCN4CjYRRq/fgHMQvXAKnW5KSyWG08u7s6kcYN/8NxwM hIeO3EeQmQUVAl3jqpILHzuE4gS6uW7uTZwDoUZq1OHy4kyaANfzZoKbiRwXFKJPfeBY LirxIawr4vaDj1WdsHsH4XV6YZZyMpfXevUNN0SyUQQaUUy3wL2dzuOV0pHF7Weima7c R5XRJPbwKPb2KTlpKa2ETYjOs4BToXepDhoHyLkkJXiPtTbIVMdjzyIhs+gv1ua61Dhc +jUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Co7ZV0yR; 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-4959879bcdbsi8752666f8f.397.2026.11.09.03.59.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 03:59:02 -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=Co7ZV0yR; 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=Co7ZV0yR9aD/ 6htqLWfJhqST2X9zE3auuTPaKFBIyCLVLuHzkHJw219PWbsHRZjjZjXeH2kC4GP4o0Lv2DLTfcVk1 qQR9qP+/CC6e8lb+oL+9wYSQ89e07f1ONIKc7meLtKt/3G6s0oiFYbwrjk0U7XOGPVSreFpmK2FA0 b82nXCZubLiJg8NO56F2oCu4q2t+V4NcnF0249plJlURyzuLfmDj71DSWaQ/2ov/ts6hMYjTi8UxW DqIl/8IZKNj0ALnZMxihjTUgR9lEpqDFNV2fxlJBA3+PP2pclx3+makcTsjiC8VpRiUgdLrvAin66 G1AMeOOjNkkVbDv7EGEeOQ==; 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 1xQNxZ-003a4R-2o; Mon, 09 Nov 2026 12:58:54 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Mon, 9 Nov 2026 12:58:50 +0100 Message-ID: <20261109115856.1362416-5-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261109115856.1362416-1-alexander.ivanov@virtuozzo.com> References: <20261109115856.1362416-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v10 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