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 0910E80BE1 for ; Thu, 22 Oct 2026 12:18:44 +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 69MCHSxp008121; Thu, 22 Oct 2026 15:17:29 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69MCHSxp008121 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="yHvQ+CeQ" Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69MCHJMt008069 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 22 Oct 2026 15:17:19 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69MCHJMt008069 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49febef74e3so6257545e9.0 for ; Thu, 22 Oct 2026 05:17:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBzNwddYJFiDenLOpb0NG52RNhgamH/IIBNsvTU2xYQRnTmmnse/NnDV5n7+VZPoWSW4/MvoFA==@openvz.org X-Gm-Message-State: AFq9FYL3crnLlHYgZUcWjOD96tyXJrxFLoinTXM9vYJ1N6QtqAejcrGC J/HwqwEom8B8dXku+dcgyKCzuSmRgF6xfU3V8Y6WxJi0Qa6N6dROsvNVyZlvB1S8oRKvRLUIbal qAn1TrC3X8j7SxsunDKa2rLNJetc0dA46EYnPKumnrJDl1mz9rH81sQ== X-Gm-Gg: AYBFou14pRhFyVXVsZM4buEQ0/QhDw2rc1PuhIxM78GVGOvLjwGjdP/BnTbew21mBnl wi8p5sAtQO40ma6+dzs+wag/ChEm5pyAE2L6bTj+jjTF07YSgMgibE7rz8LijFBCeqrj089rRox REawrqWVr65OYS72Gw6jq/b6R6FIzsttrfiLUcx5Z2n2sfTFIHrVb3SDMtKcYUyMvG0ZVMpF6p+ x3Cq8BtASBKONEKuXKJm7U08x1RybPnS2FpMi+Eq/KqhlWwTQ0Ob0uEEIYFVbU27zdCwlnP3+1S hkDgPdf6FaOLvn4Ty/HF1G4cP8y813ci3RpA8pPiizIuKLBd+wGEaAEu/1U3nSgLwF4TYDsDoVj TARdaSGi9xRvrkDgz/OXl8yI3o91a X-Received: by 2002:a05:600c:4e0e:b0:4a2:6ef:7bd8 with SMTP id 5b1f17b1804b1-4a206ef7c6dmr41757205e9.18.1792671438776; Thu, 22 Oct 2026 05:17:18 -0700 (PDT) X-Received: by 2002:a05:600c:4e0e:b0:4a2:6ef:7bd8 with SMTP id 5b1f17b1804b1-4a206ef7c6dmr41756645e9.18.1792671438146; Thu, 22 Oct 2026 05:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792671438; cv=none; d=google.com; s=arc-20260327; b=r6ulVNL4UPc0swoBTQkzT6YSjxlYVeNLjLp3MboriD3MXOp/PrIFrlnJerB2zwyQMa tYrwx85piFhzqTDHNoGQsgyb6pM+/J85JCKeHA/+SfbAiQqIHBY9dILhxXI1CiebPvoB k2NADJkncKWE9LnijSBBNj+QfFvgRnLJAY9GfUo4WLm0Smy2S3cMopKa2e2BEzBpDxVr uDmqftVAkF/B1j5ZPISK+fDd798/kzXsnTWzjsnBxAOa9uBzPjivrCkB6g3G10qVpAQY Bu5us67TUVt2rdOxjDCfIViuZ5aV8qvJrNhW/sYNOisf0OHXLOgcPSEASSZYcTAdZPI/ l3cw== 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=hAfhtez2XH5tVg4VB5GIcFF5OQexpFYw41Hc2gRUWRc=; fh=1MEQxOGYABaQPNQS1Ckioh0rrUOwgCYjd8t5csgx5as=; b=AUahLNTgKfBueS/8G0pa8aSjJ1UX0kJXuFQMfCJ6GIkbHx7BYsRe43iRj3e+YOyybE 5TWMBtZFLYpamivaIwbkl9mxiHxr5vYk97uju3HCfCJ+kJX3J9dxDFAvtzYx0WfSIkG4 kZ23DqBqy+/7NsLKOlYUUNEFXXU/o28qnFLiOuOiW70ze2JX34ZulnhEz8RW+PifYvIY p2Q5ENrEa/nO9M73y/D3PyTRfhRe4iq8vro9CgeqQpF50I52ZRCirij104lfB4k1FxvQ hz3qakTsHyu6KAce8BmbQF8a0OsCi5usNo6kzTt4pwmPh750EU2oqTyN3M5WLaOCG84G ezTw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yHvQ+CeQ; 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-48e25871988si10680870f8f.307.2026.10.22.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2026 05:17:17 -0700 (PDT) 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=yHvQ+CeQ; 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=hAfhtez2XH5tVg4VB5GIcFF5OQexpFYw41Hc2gRUWRc=; b=yHvQ+CeQMyWv oty2jMVl7IHMrvxT9hPaMWWbBebEyt/e2mSNoJqlkQ2GZd4vFsHYazhc5iEA8WOJdXb4l0A6VX3/6 ITDzG7q/vM8VWInfEhy3FrRwE2BC7UtOhfb8sSUbWm1e3usgTRPC0DUn/wkNIPu3v6boRfIIC+D90 5fH3TluA1Fr/LrPbBG9gFtJpIT3TrBbUvIcEg7ejtuIyCetUTCLmnQDEivbJGUfCBwZFPAGUtWA/9 mhVQTZMZUNMMcJ3LwEbyaV5eYiZ/Lt/rKjaE1BhUMtvY8y1t5iE2rdN57UWNyrFUMaIBkmPKuuxrY El1U5TDs+3hKr+CjdQqH5g==; 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 1xJrfo-00Dc1n-1b; Thu, 22 Oct 2026 14:17:15 +0200 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Thu, 22 Oct 2026 14:17:04 +0200 Message-ID: <20261022121706.1890593-5-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261022121706.1890593-1-alexander.ivanov@virtuozzo.com> References: <20261022121706.1890593-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v6 4/6] 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 R2 after the flush, and the change is never written back. Complete the wbd first. 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 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 810dd22425ae..ef832813b718 100644 --- a/drivers/md/dm-qcow2-map.c +++ b/drivers/md/dm-qcow2-map.c @@ -2884,13 +2884,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