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 246D080031 for ; Mon, 23 Nov 2026 15:38:06 +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 6ANFakc5021133; Mon, 23 Nov 2026 18:36:47 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFakc5021133 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1795448209; bh=xfnGNKAbhjVcF55g2vhxWYQsT0Q5VwrkByAd70Y4XLU=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=i5JLyvV14Y2AIiW6WW53d2G3Q/aaZ6dm7z1GfQvdYBxZj5MYUUWoO+zytyQwSg86H GYon4IlBDmwRmyiE+Zk9Xs4slTyPpySy0z+PSo8nIGQp6LxQ4CjRkLzCFgyXj4edFx AeEA6fsna6QfjNveBLJUglEaczMqM+gvtCODrEJf2qhPE2crtiEBBHVkST0kyXXXOS 9EqT7+SwLe7RLO6gcxwnxnCB7tzzFuOHuiM/840HfwekNl+q3V6jY+YuVpB1Gi/D2O LkezpoRPOkb1wxXGmI6T84duZwuvd6i6vboQfNsfQbtues8UK1t9GsYmBaFLpcrJxN /9qJgtrel0m5Q== 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 6ANFailx021126 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 23 Nov 2026 18:36:45 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFailx021126 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="p11fT2Qm" Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4a204f135ffso17690005e9.1 for ; Mon, 23 Nov 2026 07:36:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFCZQywiQAXyFocWvGReG0yETj4a2ONmcaIvDymdkV6puStmGMvNtn+H5TJGnjCSWEzsCFINg==@openvz.org X-Gm-Message-State: APuU4Z++H0wns9crP+OkiwILy8GpT9r7xp6RTPM/pA3soLWNdjVlM3CX 4d/X7MqmlmziAMZJ55AJaVocqoMtmVVAfELIOXCsIB91iKa00XxdBS93QSMyejM6Eef35XwJkrF 2Rmq9yykdkDlCwXykTHHu83Bg1Pu4V2nJRUnqMdxM4hLt1JGoKkdB2w== X-Gm-Gg: AZFdTZd3FIphPty6Y6GZv24SGBEnYR/8Svj05T0NzlQXbs34MXXFs5wA+STR+Xd+LAi rrDOFoZiAzgp90UyJEYG/YD6Plefn29hrhA3a9DnKeq26oWCArWXvj7XgeR4re6RKIvNcEDpBtb +FzEKNtl2wqiZRZMI6Avn+62xqgEpIbUhxLxVPe824Gt0GBhoL0YTQtXx5t6pAkNqvFbX94JwrB c7Wobv7NopQYgKI3oqMnrIhfu2lp7J8dyCUL1QzybGT6CKJSj6Ysvi2ApszOtST1nqpr8PcwUnT 6JzU75ChPw== X-Received: by 2002:a05:600c:530e:b0:4ba:eb:eb9b with SMTP id 5b1f17b1804b1-4bb8880aba2mr238464455e9.8.1795448204593; Mon, 23 Nov 2026 07:36:44 -0800 (PST) X-Received: by 2002:a05:600c:530e:b0:4ba:eb:eb9b with SMTP id 5b1f17b1804b1-4bb8880aba2mr238464045e9.8.1795448204226; Mon, 23 Nov 2026 07:36:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795448204; cv=none; d=google.com; s=arc-20260327; b=jxbwL0+Lr7X1cV+Ko4xR5dXUlJxBR//fBMfROzTdkGVboi2PIECTApwRHqroIxXXJa scayVXb6J4Vz6HSkFMlFJ2lYhrdWaA70A7mxtEtZriAAtbrS9r+Kzq2DVAMpbxKES0sj uKRf4PWMyqaEr5wPm9bYcCzPJv7asYQhO11wKUQLFFrg02hKX2CTONGyl/5I5rG8WApn MvaZwExoUup8lEcLV6TrX0GyPXLN7zqRDRjnZi+so+xu+A4rDCtP1n7dchQ9RsYbGiTI FqCdV4BwnRHf8QGzBaW+mozRVPdG4Z2MydJtZ/qjwaIkQX0g4IyIrzir4m8a4+jwYwFp gFYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=yhII1NY9E4vrneqFJCX0eljsmpPEzN0toLqnyrrDcFA=; fh=KdP69vw2bTgsgv/jA1U4rHMsufuzzJKB2p4J/prCTlQ=; b=Em0hfv2QU9JKpvtOBqavaiEMyVsEENCwZC87C/fkoKBquiBMZ7M796Fq+1IZyHsde5 eLudbBgYVyM9JofpS2wjMYDJKdMTS/ZsqPV4EqMO9PmzSbgAkJ7qSPhwr2BilPmgiUNA QyU73tOZACjDdf5Xrtv9OWL8O50fXdnt8Z8R3W+pg09G80Nuv2Kb2v4K2QCC3rgyIgfk QDuGdkxvalkogKBTGcC2f6avQpPn6En5M+BvqoiGBGH7SvbWZd7qJfhJlG1XKKQhU/zv 3mNGfOEzkqJzibyPkygdUXo74lyg1PtelMpMC2JNJ01sMUtKzHbK9d8NeqL6u7YcdMAd OCNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=p11fT2Qm; 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 5b1f17b1804b1-4bb8916614bsor15695355e9.3.2026.11.23.07.36.44 for (Google Transport Security); Mon, 23 Nov 2026 07:36:44 -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=p11fT2Qm; 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=1795448204; x=1796053004; darn=openvz.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=yhII1NY9E4vrneqFJCX0eljsmpPEzN0toLqnyrrDcFA=; b=p11fT2Qma87HszYC2gcrPfhanxNtXHXnPFJ8zanaRVsDfM67h6kLfFgHYTEna1OvYU yvvWJ431mz8ymGOlY+Qk5vBUYR/8J53/9PVQCcBDPWQEPxEq1g9PzxM4NH+hAX7ThOPm 3xKnDeeL+R7e27g3YwG1hEyPjfhP/Jj8+OwrtokDXwnWLoPZnpQ+L12kc80CDQPQqNKF oeJAoyU6ofZWSWCQChxat4FrO6G0JPQmeYWf101N6eaZxLpU36AuRFFfb0IZUe/2bSaF pniA7YF8l2xO97i19D6fn7SJZVlc0EB1nnF6TkWjyC1JLb+ssmX1fz3eF6/SvjSwkvMV HoMA== X-Forwarded-Encrypted: i=1; AL+hErF9nZvYs4NZxanow5HNHYSlc7ykqBLefLqdnWA4ltPqYmZ6I+vM3XIM66FrDE5oj5O4indQTw==@openvz.org X-Received: by 2002:a05:600c:46d0:b0:4bb:7987:fbc4 with SMTP id 5b1f17b1804b1-4bb88817eb2mr245973085e9.19.1795448203675; Mon, 23 Nov 2026 07:36:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2026 07:36:43 -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:32 +0100 Message-ID: <20261123153640.128227-1-den@openvz.org> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 0/8] dm-qcow2: fix image I/O completions using a freed target 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 Suspend waits only for the inflight references, so a completion in the backing file system's context can still free a helper qio into the target's pool, queue work on its workqueue or wake its service waiters after a remove has destroyed them. The same holds at backward merge complete for the merged image, its timer and its workers. Make every completion tail end with the release of whatever keeps the target or image alive, and make the destructors wait for the timers and work items that are not covered by that. https://virtuozzo.atlassian.net/browse/VSTOR-156036 Tested in an HCI 8.2 VM with the races held open by hooks: stock oopses or corrupts slab in each, the series waits them out. The ploop test suite passes in qcow2 and ploop formats, and on the debug kernel with lockdep. qcow2_presuspend() still skips a re-armed enospc_timer, which delays a suspend by the ENOSPC timeout; that is left for a separate patch. v2: no new counter, as Andrey suggested: free a qio before its endio callback and reference drop, and keep queue_work() under deferred_lock. Also fix the service qio wake-up, the slow_wb_timer and worker teardown and the merge work in the destructor. v1: http://lore.virtuozzo.com/kernel/20261119114914.767536-1-den@openvz.org/ Denis V. Lunev (8): dm-qcow2: drop the qio argument of endio callbacks dm-qcow2: fix do_qio_endio() freeing a qio into a destroyed pool dm-qcow2: fix queue_work() after the target or image is freed dm-qcow2: fix service_qio_endio() waking a freed target dm-qcow2: fix qcow2_flush_deferred_activity() skipping a running timer dm-qcow2: stop slow_wb_timer and flush the workers before freeing an image dm-qcow2: cancel the backward merge before destroying the workqueue dm-qcow2: flush the backward merge work before freeing the target drivers/md/dm-qcow2-cmd.c | 37 ++++++++++------- drivers/md/dm-qcow2-map.c | 80 ++++++++++++++++++++---------------- drivers/md/dm-qcow2-target.c | 29 +++++++------ drivers/md/dm-qcow2.h | 8 ++-- 4 files changed, 86 insertions(+), 68 deletions(-) -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel