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 B6FBD80032 for ; Mon, 23 Nov 2026 15:38: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 6ANFb3KE021215; Mon, 23 Nov 2026 18:37:03 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFb3KE021215 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1795448225; bh=TaoKIxlJzMTtO5f/nc6O86LLviJY3UW1vhLVBVRH4xM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=Z8VVqZCKLhF9uaWa8hVpyJTCNbjEKj/PaXTA4Ap2MNfs9YwvqqwCuKOgM16UjZmBd 22VGjJb5/GEnFiyxPoyrFxcyoSFI9wh2PjmfTVz7sE6fcy80dkH4So8cl22s8Ud3bW 1nBKFVb/otT60ELVAWBnSj2QDzzW7Gtc1w+MVs1nmY00PDq2gVkiFJFPktN/Ty2O3B uafCNKti4yeNeYrv6H0bnU/8YbsTBqjP+T+NwX2G6VGBskWXuSixaODUOL3e2fe3lQ pG+kbmycNpXFSOJnqCL3dAtbb2ac1VZrbKPnSBdewYo9B116RKGHFPOsDJsTS3Qj/2 6wIm+OUgwZo9w== 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 6ANFapP7021160 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 23 Nov 2026 18:36:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFapP7021160 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="tfc3tklK" Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4ab341c0696so980473f8f.0 for ; Mon, 23 Nov 2026 07:36:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErGpmX8X3tsbW2HjpMRI9soRdevUwdIrZHsPrsnr7ueEFCqqNegK0bSsYZ5cD2uj8oDEcBolnA==@openvz.org X-Gm-Message-State: APuU4Z8K6FqWa0qxBAFeN34J0V/jJctURz9O4tSrk7XWcqqTr0V5LDJR rrf3Qt1wAeZHU/J1NyNBLNjNY/fZ9u13mYr53ht0hmMX2T40Aov8/QaJ1pLDYwwixvWAwNeOwDF JKT98xGAy+bBWOHK98rPVR3npTMd510BmWww8HWEV43cODwyz+GGEtg== X-Gm-Gg: AZFdTZe7KXjZeCAmHg9pFl5ZVSJHFRmZWqVU947IhC469HLtBAMCkDB3u7TeRHYtets KPv7CbfFCAhMa4efpbHHkFurAOmpCWp5j86TVo3Ss8pBuxrAJjnHJ0RL7441EJcYFgAPHmrdTO1 9UaLJJvgjPxQGIpnu31r+dPLnKH3hP76DiWOQAS2SK+68R/XTTuclxs63F6bDBWij8dssLOTy7L 5SzjfVIDzowJOcWkqZ2ESiDnNZYn8BBC8R8NqbWewHH0Unb9DG0aHWnXmTpc2YnnSoWh781wJRB GzeEmwAjQA== X-Received: by 2002:a05:6000:2887:b0:4b3:e5d7:215a with SMTP id ffacd0b85a97d-4b3e5d72317mr5368802f8f.24.1795448210767; Mon, 23 Nov 2026 07:36:50 -0800 (PST) X-Received: by 2002:a05:6000:2887:b0:4b3:e5d7:215a with SMTP id ffacd0b85a97d-4b3e5d72317mr5368757f8f.24.1795448210368; Mon, 23 Nov 2026 07:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795448210; cv=none; d=google.com; s=arc-20260327; b=qY4EBIrit7y5h3seWKJbUTNAz/HKcv2f2qT4GFi6gffzRy/Hl2/t5lR0Y8QDbh84Jr pSsgvXUVF+AZZG4jauLlH63mtwmNoAeRgkLtemWolM0kfwWv55EEcL3jJr6oN5UVUokb VfULlFmyxTm4ULavULSE43HKnKeAQFfjAjYaoEv55JbKAMHcsiWOVd5mIUjc+D0VlHbM UwNBwAF2jhhRhX+2byXD2TblOfDP7U6tKuykOZox+IrNN2F+TbZwDWX3Ef+FI+v4/+QL oDwB8r+/ELUtC/SswM9XL1XBPYMuaQE7LBGORHkgiK8wmWrAxEP2sisWp2ZFq8Q7DNgx +6GQ== 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=MdBce5Cx8bQdqJACcFaFmZOcFkMpPt/UOKyM7jCqkks=; fh=uH6PrkfkZPg++NeroekpU91Te5smY0OGJi4uLYo0rOQ=; b=T7u0SQ+LZTvgjRQWp9AzVC67KAzzQgz0kurC4nUsjmXQgzFoYZJoxLVnj8yNrHq5LZ rwVvFDOgQg/NXn8dgxStx/QEujE0GvsHKUwTB4MaCrhjv4F+OQ+uVj9ZZOJNIFEB6CgX Ez8QUPXw0HYSTKPDLX9x3hjH52NU0ZOCtkPSK2v8QA0mw9tKECgbcNxh4Kt72UZDXYyE 4QQlS0J9qZ7yp51S7zK+49w3kxxSawobkLW9z0HuEOaxFTA42zwNyFekNhNEUdwXok6G gtYg11YFQbodykI0qKxZExF8+KVfKED171enziKrn0VeAotLNmAO3hMMEx5En/xJdvlc 3Aaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=tfc3tklK; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-4ab6c153f3bsor2509045f8f.15.2026.11.23.07.36.50 for (Google Transport Security); Mon, 23 Nov 2026 07:36:50 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) client-ip=2a06:5b06:b600:300:62d2:2eda:8655:4219; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=tfc3tklK; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1795448210; x=1796053010; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MdBce5Cx8bQdqJACcFaFmZOcFkMpPt/UOKyM7jCqkks=; b=tfc3tklK2io1AKCsNXGbkH88roqjtFSHZTV+nbmX036VDOgXx7WzAQ77bK8S0NAask qRQ+GE6WHmPyh+MdhynmQs87WM+KFqEn4WsahbiXcpkYnL5a14jDi3aGUxju+Fccw+jN z6CBBLA11mP7iGaYziAdHkVLoQ+gRALYH8iR3EpHsa09DgveympLAiFokWuSUzncJVOc 7K+FF2Kt2T8FvKUki/WxCAFEZlOByM3qavxxQrx2D1NtuJhH8Iib9SubNQpZ23ejzfv7 VHTZSXhGliV3PwZI5mOeeWFiay9kUGrGeXTS0TBf5khBwaP8NPg1hTczRQYiVk7KPGwe 3h3Q== X-Forwarded-Encrypted: i=1; AL+hErFNghurfwIcAGuqq3IVE/J44a0Wr7cT/tHihIi4jbF3Oz6VtLQ3En5C7ayurnBowMsi1ziOag==@openvz.org X-Received: by 2002:a05:600c:820e:b0:4b4:262b:88a2 with SMTP id 5b1f17b1804b1-4bb887c9f5cmr241897105e9.1.1795448210028; Mon, 23 Nov 2026 07:36:50 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:62d2:2eda:8655:4219]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884b7515sm491797455e9.13.2026.11.23.07.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2026 07:36:49 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com, alexander.ivanov@virtuozzo.com, vasileios.almpanis@virtuozzo.com Date: Mon, 23 Nov 2026 16:36:37 +0100 Message-ID: <20261123153640.128227-6-den@openvz.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261123153640.128227-1-den@openvz.org> References: <20261123153640.128227-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 5/8] dm-qcow2: fix qcow2_flush_deferred_activity() skipping a running timer 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 From: Denis V. Lunev qcow2_flush_deferred_activity() runs the slow writeback timer callback itself in each of its two passes, so that dirty R1/R2 pages are written, but skips that when timer_delete_sync_try() finds the callback running on another CPU. A callback skipped in the first pass is over by the second, as the inflight reference switch in between waits for an RCU grace period. The timer can however be rearmed by an R1/R2 page that the first pass failed to write with ENOSPC, and expire just as the second pass starts. That callback queues the worker after the last flush_workqueue(), so the pages are written after the flush returns: after suspend has cleared the dirty bit of the image, or, at backward merge complete, on an image that is already freed. Wait for the callback with timer_delete_sync() and then run it unconditionally. Every caller can sleep and none holds md_pages_lock. https://virtuozzo.atlassian.net/browse/VSTOR-156036 Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files") Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Denis V. Lunev --- drivers/md/dm-qcow2-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c index f839b444b328..2a51beaebcab 100644 --- a/drivers/md/dm-qcow2-target.c +++ b/drivers/md/dm-qcow2-target.c @@ -177,8 +177,8 @@ void qcow2_flush_deferred_activity(struct qcow2_target *tgt, struct qcow2 *qcow2 /* Do not redirty R1/R2 failed with ENOSPC on the last pass */ for (i = 0; i < 2; i++) { WRITE_ONCE(qcow2->md_wb_no_retry, i == 1); - if (timer_delete_sync_try(&qcow2->slow_wb_timer) != -1) - qcow2_slow_wb_timer_fn(&qcow2->slow_wb_timer); + timer_delete_sync(&qcow2->slow_wb_timer); + qcow2_slow_wb_timer_fn(&qcow2->slow_wb_timer); /* Start md writeback */ flush_workqueue(tgt->wq); /* Wait AIO of md wb */ -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel