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 03D2E80032 for ; Wed, 18 Nov 2026 23:40:26 +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 6AINbCBT030448; Thu, 19 Nov 2026 02:37:13 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AINbCBT030448 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1795045034; bh=wu3Lj1CXPMEdCDkIuJVfx7pbEcQmhr11+XXWP+bRad8=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=JVMS0ylYovIrW12yOJ8ZfWEbB4y+OOsy3gbO1S75pRDV+5/GdjPhJgrvypPDmqZFY yN5vOJ3AE4pw+seba/S7rC3W8JoA7Rjcxkqd+sdEe9v19HJBL+Z8EQgex1aKX93ypb xW62Ki7ltvsrTlMJ5oeJooIz7BMDG21KXkViaOQWx0rVTn3BmXwciaOpqtgL2G44Q1 8VSNzeeWMQL6Y3s+wrcOC+lSe/UZQ31hINoFJr78Ec7Zm0blXAijnd20JTc8mJyOQW UJlV1Of9ahnWTqaY2LjffW9FSDO14JyvirZve2QkLjCymXs+JLuvs61Ddb7JqYj0cR bCpsbOFad87QA== 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 6AINb9CL030433 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 19 Nov 2026 02:37:09 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AINb9CL030433 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="JmzzsFXp" Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-49337a224a8so1066883f8f.3 for ; Wed, 18 Nov 2026 15:37:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFrt+Q2tsF14SxR5oxmlsHNV+7RG+PNeNx3cRWYauqcNmqcC8TD3MxWf3AWVknrI9pxV5S6Dw==@openvz.org X-Gm-Message-State: APuU4Z93JCmeLJU7gLSGNS7ioBmuCSuVAVXTmY1rhdSziPSaEc8Et3Bd SIX2ErEhjqwaQjo//KQMj00WtoSnVzyuhURsTm56d3r2GSwka10X5xBCECbSzNhTX0ti7zvMd+Z 3VA79A+BzgX7VNPLgWOcbwv37YGNAmQpnLSvl3MQm5ajv57DlXuqvlQ== X-Gm-Gg: AYBFou2MBWnN963S/iZz9iZu+skqgK4Ri7VwQR/+XERZBPqI2xXtppEz6ml5JrMjL3u VwAwCMofAO2MvteeFkd1jy98uNAumv5Aq7p+o6xvetHvm4QP7V82L5EGSe5gVK3HK/2IpJnWr4m Llm1fqbYtneHiqVM4NkPUqNG/oFCpegIwcp2RfU9zIe1AGdgf+ExiGq19JaxgF6PRuMDgpvGYXs oySKtqkh5fo6ReVZSTqTWjHYYuTRuHkzd1gNX45+D5961M6YPU5AvlXXOK278V+1K944mHY072m joByXNTPNg== X-Received: by 2002:a05:600c:8b63:b0:4bb:6871:8f21 with SMTP id 5b1f17b1804b1-4bb7da27fd2mr81096655e9.23.1795045029076; Wed, 18 Nov 2026 15:37:09 -0800 (PST) X-Received: by 2002:a05:600c:8b63:b0:4bb:6871:8f21 with SMTP id 5b1f17b1804b1-4bb7da27fd2mr81096505e9.23.1795045028746; Wed, 18 Nov 2026 15:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795045028; cv=none; d=google.com; s=arc-20260327; b=AI4IDKF+UsA64Z5HYurpbgKgCWo7fh6Du05X0H1cCF1xftzPCaAVfx9Xf2fIgouKtb E/MUzfQBS9UuERoYlg8SEeGA25rBMvsT3X5s/7cpo0nSsZ/hG5txx/PZMRVBFEWXOCkD KUao2sCYjRUTEHPiZk2cUKa0MTThu2sBCRfaUqnbZpc8UY9Cv0rN+i9u7Wd0ATWbNS+b ukY9RaZis96dH6nNQfGhcB8+gYBMQdk+tJC18XIwl8PEmE7nRpFtPM1hvAwVr6fGRY0e x9w0KarZB5HWK5hBXnEwRupelIpAGLsbaQ90zD15X6iwLVe/FlcL7lvt4WNE4hsJglCF 0IXQ== 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=EW/znlBPG6/hp3E+qaGsH6cCGZmrjZJ9Sgz5Y8weTP0=; fh=rQh7xo42X+XQUKq9DUd+2KbJqL1yvNqS2il6skfIbFM=; b=GZJKINNPsuzo8tjwSU45sSX0lhyMYyTQBIzwCnAJ+MRjrBKtZJxKWAkDqAjVIrdcTI KHQMlKPuwSQogTI8iOpcvLN7OdUUKPhCQgCzSlwyUlYXKoszu6iocMkxak0MiYvuzxC2 OY+KFVknVeKPmLXLh8x190ZpfdiHxAB4ofiTz/0aY6yQqkSXM6pbn8xjJKgT/Z2DxKzi /ooV0g7mOi7P0Oy5IHomlmxxwaNtnJgFFTGXkH9C92KGX5I+06mCf9mWVsT6zREoo7Lv oCf6Y+t0UVhdmurSjBLmdnLvxSDwZwG8ERw5pZMT2p+kTMM+AO/yw6oAluntE6hxa444 fv3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=JmzzsFXp; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:8c09:3cc3:6efa:ac1f 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 5b1f17b1804b1-4bb7d712f4fsor5733975e9.1.2026.11.18.15.37.08 for (Google Transport Security); Wed, 18 Nov 2026 15:37:08 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:8c09:3cc3:6efa:ac1f as permitted sender) client-ip=2a06:5b06:b600:300:8c09:3cc3:6efa:ac1f; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=JmzzsFXp; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:8c09:3cc3:6efa:ac1f 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=1795045028; x=1795649828; 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=EW/znlBPG6/hp3E+qaGsH6cCGZmrjZJ9Sgz5Y8weTP0=; b=JmzzsFXpb+6pqlqh2l7T/tIdibT6QGxu48xXHAcdA3/Ntj9+nAa1jkmdaKHasdlfEz weGeZanLs3M+oWk+chkOpPOoj91cktbmgoFrSiM72wFqFJuDFNWLBuFjpPC1NIdKGPAR HjA0kew16LZOeA2TCnNQexDUtc6W1z8lpWYQwwRYgF5AiS2jeatwvF3KbRo5wHarNk2k Edets/PlvJujyXwt3JNRDFuZdLl8odc6AFneHy+kD+JX5HVx4KYEFZKSs7jh3Z7A7t8X zqrMzzyh7e5cZVQwYqCl43ql/kSk3n8MUhyoslwmiUVmSJmaXINRCQpiCQjPh846uSK9 BBfA== X-Forwarded-Encrypted: i=1; AL+hErGWXlS+z3MReFrqleCiQa/MiXLsLaK/fKkMVcXTPlIytr0ZykGzVnPHucTKx0N0teG7r6B50g==@openvz.org X-Received: by 2002:a05:600c:3485:b0:4bb:6c5e:b006 with SMTP id 5b1f17b1804b1-4bb7d6cc1fbmr75915955e9.3.1795045028429; Wed, 18 Nov 2026 15:37:08 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:8c09:3cc3:6efa:ac1f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb7e59834esm44871465e9.4.2026.11.18.15.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2026 15:37:08 -0800 (PST) From: "Denis V. Lunev" To: alexander.ivanov@virtuozzo.com, vasileios.almpanis@virtuozzo.com Date: Thu, 19 Nov 2026 00:37:04 +0100 Message-ID: <20261118233705.3974832-2-den@openvz.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261118233705.3974832-1-den@openvz.org> References: <20261118233705.3974832-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 1/2] dm-qcow2: stop enospc_timer and event_work in qcow2_tgt_destroy() 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 The destructor never stops enospc_timer or event_work. qcow2_try_delay_enospc() arms the timer and queues the work after it drops event_lock, and nothing orders that against timer_delete_sync_try() in qcow2_presuspend(). A write that fails with ENOSPC around the presuspend leaves the timer pending after the suspend. Once the device is removed, the timer expires on the qcow2_target that qcow2_dtr() freed, and __run_timers() walks the freed timer. A retry that fails while the device suspends also queues event_work, and qcow2_event_work() reads tgt->ti from the freed target the same way. Shut the timer down at the start of qcow2_tgt_destroy(), as its handler resubmits qios onto tgt->wq, and cancel the work after the deferred activity is flushed and the workqueue destroyed, so nothing in the teardown can queue it again. alloc_qcow2_target() sets both up before it returns a target, so they are valid on every path that reaches the destructor. https://virtuozzo.atlassian.net/browse/VSTOR-155933 Fixes: 6e2ec304689f ("dm-qcow2: Pause IO and notify about ENOSPC events") Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Denis V. Lunev --- drivers/md/dm-qcow2-target.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c index 4cd5f2c0ed36..2f792d823e7b 100644 --- a/drivers/md/dm-qcow2-target.c +++ b/drivers/md/dm-qcow2-target.c @@ -244,6 +244,8 @@ static void qcow2_tgt_destroy(struct qcow2_target *tgt) struct qcow2 *lower, *qcow2 = tgt->top; unsigned int i; + timer_shutdown_sync(&tgt->enospc_timer); + if (tgt->wq) { /* * All activity from DM bios are already done, @@ -253,6 +255,7 @@ static void qcow2_tgt_destroy(struct qcow2_target *tgt) /* Now kill the queue */ destroy_workqueue(tgt->wq); } + cancel_work_sync(&tgt->event_work); qcow2_merge_backward_cancel(tgt); mempool_destroy(tgt->qio_pool); -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel