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 DB8F1811BB for ; Thu, 5 Nov 2026 14:59:16 +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 6A5Evt15005831; Thu, 5 Nov 2026 17:57:56 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5Evt15005831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793890680; bh=meIQ9c5q/r8IfmqK7hsliqVpTuSbi5tXBxNemmjWTHI=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=amWVfaFg241pM78T6tufWp2TuVdsTIPMfZeESfqXzgMcFZTL/okcVntmYCO0kqPew mxfDnvCvNG4ssCyHZBuEfP5Ys5molQZBjXBf8TifEf7t8mJcCxngVxQFT6eypDX+IF DEWPJMXwlFZTUth7UcebciniG5zzLBob/4oNmorP0MwNo7A0NO+8OhNEVIIY6HRPN6 w/mrV5H4gt4EHU6vOjTDYRzlM0TlzcI1X5GU3i7LQUB1HUbH8ASV4amglprYDqoL+v Jl+FIIgGBjCABVNBZjMCARuMGHkkQ91BR3s34qIYmGPBDzyN1uOEK+iARq4ZNMoCki ZKJxSqzloyT2A== Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A5Evr5I005821 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 17:57:54 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A5Evr5I005821 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="efRpYSS+" Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-490a0e72578so1290229f8f.0 for ; Thu, 05 Nov 2026 06:57:54 -0800 (PST) X-Gm-Message-State: APuU4Z+gY32OEEhI90oH5awcRhcmIHcyKXWhsRi/LH2MUi13mgyOTRRo yjWUOTXZ6o6BS09ozPC7L7hd86ch7lHUN17KMHcF3BPQ8v3P2RzOkRfDVYXwptudgZjL7yxNDGK nKWUFUGzt7KSSIGDeFhC2iMnK5vNkVBtRYqcwKCnRF2Qg16/YGQ5cGg== X-Gm-Gg: AYBFou2FaPOiTgrvN4bLgzr5eSdNqX8alOh8lpoSmqhiUV/h17HoHqGNVIyr7b3dTyj hyhqaegWz0yOV+Q/tzTwMbbqu8bWn+qVYMLAiovLosfZYlZSfxGH1a8t3MNz/uYl9vPSPwFrvLX FfBLNL5Sx96w7+Inoo3MAky2gNHog1xP5qJlfp0cVzGgW0K3VBufkM6Un+4ypPN3/ssr1CNQJen cddc9AbX5Aq9rVUcKvGvlNL4iVtLNQoj0Mg1tSMQeajIgXuOLoUmeXYI/TYvl9UJUUjxFAdrKxC Y6qCUQ2oJg== X-Received: by 2002:a05:6000:5c1:b0:48e:7470:9eb9 with SMTP id ffacd0b85a97d-48e7470a047mr36119739f8f.43.1793890673048; Thu, 05 Nov 2026 06:57:53 -0800 (PST) X-Received: by 2002:a05:6000:5c1:b0:48e:7470:9eb9 with SMTP id ffacd0b85a97d-48e7470a047mr36119704f8f.43.1793890672627; Thu, 05 Nov 2026 06:57:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793890672; cv=none; d=google.com; s=arc-20260327; b=hnMykChX31lape2KJX8rSW9yu7AWdbMcQ5Vd5DKXLnhtWdKs07xO4t0b+w47oBJ00o KdLKpK4l5xjarNUnyhTfvsz4vcFEEf3VJSdVJyr9yIEguakLvZ/RXsqZql5PiLWdVpJm Vfjx/dsEcynk5nniabg49n7b5GQarzyr11pGiB24d0oqyAQMfTAnF43ZJ+bYyA0ChQRd I9S5hrAblhV0DA2m63k0TcYTbpS2VSZ63S+Z1g+EOj++9F6UTNF5SPrFivXeCu+XbcZn +iuzkbp8D3Kj9ITUV7ys/OQhnvRXrWb3OQVoAj5VnAtodWKMIOxIPjihwru2CfFEJSun hquQ== 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=T/s6YyArYKLEuaoCgxxGbhqj5qOQOV44YlNlklKBaow=; fh=ozrYJQ1t3QIP6s65KBq5xgJxiFM2qf+5wwn3ABTusyU=; b=AzQLG5uzcGCNbBrm4BZLXvN89bSrr28ZQ9vUQIZal+3L2LshePm/H+7s6htUv0dBCg sMFdbG1IXRnTVDbf3jjdYyPtjzOrDABXhcFnJ9ovF3cqwau54uXA9PG/KZ0JXkPzyRt1 BZaQsMQfz8FbOAfZpZTBdmOiw01MVVuz5LL1x3066BCu93bf2t5/tSwUUnjUt0cqcWiw BQiOhcR82XUhgHDF2UaoilYlMWbSx597yQPDONSndSHJHY1fzzvXzZ39cxgoLTpQJGzJ 30AW9XbVjODnjxfyb2XVwhT3nkX5LMVt/u2K7qyrU1p97zVyHLaNarSI1+uxWPhLTVYw 4nGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=efRpYSS+; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 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-4918c1e09d1sor415581f8f.5.2026.11.05.06.57.52 for (Google Transport Security); Thu, 05 Nov 2026 06:57:52 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 as permitted sender) client-ip=2a06:5b06:b600:300:3848:9c8a:8cf7:6236; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=efRpYSS+; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:3848:9c8a:8cf7:6236 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=1793890672; x=1794495472; 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=T/s6YyArYKLEuaoCgxxGbhqj5qOQOV44YlNlklKBaow=; b=efRpYSS+suZvPm2gp2ym9Ts9B7f4lSHgnkN6Nk/c1M68Pb2U13Xm+G1Zxo6fjVTiYS 4Afilc7QS1vpXQKy9UbEASIDM+Kf6Iz33ax2KcipLFzL2nV6l78wUM0d+PLHOV/JQycE WKC60w8A2WGEecTZrmwAXMD1etougPzilSon4np/M9F/JJXHRU33kq1fAHDRjuSyaZer oNOO37rK2PnOFG3RRm/8DSQN1/HDhMmoM+M1t8EXvWDvlMGPSTzRNbP1CH+szp6qE6U6 +RMYsvG9ed68kRYQCdSfMGk/u1nhL1ZxNmZ/ntPwory5gjCr9H9g7KLEhuVQoZDgifeY DLcw== X-Received: by 2002:a05:6000:2584:b0:48d:f3a4:a6aa with SMTP id ffacd0b85a97d-48e6e305418mr39838492f8f.35.1793890671947; Thu, 05 Nov 2026 06:57:51 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:3848:9c8a:8cf7:6236]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48fed92a753sm11719747f8f.45.2026.11.05.06.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 06:57:51 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Thu, 5 Nov 2026 15:57:46 +0100 Message-ID: <20261105145749.2643035-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 0/3] dm-ploop: fix flip_upper_deltas panicking the host in its pre-flip check 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 ploop_check_delta_before_flip() runs on every flip_upper_deltas, as PLOOP_DEBUG is always defined in dm-ploop-cmd.c, and has three bugs (VSTOR-153445): - patch 1: when it finds a cluster both deltas map, it returns -EEXIST with two md_locks held and interrupts disabled. The next pio on that BAT page spins on the lock forever, and the host panics on a hard lockup; - patch 2: a flip after a grow of the device, with the lower delta left at its old size, oopses in the walk, which runs past the BAT of the lower delta. Refuse it: a flip that got past the walk would damage the new top delta on the first BAT writeback after resume; - patch 3: the walk stops one page early when entry nr_be - 1 of the lower delta is the first one of its BAT page, and misses a cluster both deltas map there. The ploop library does not get there. Its reverse merge, the only sender of the flip, grows the lower delta to the size of the top and, with the device suspended, clears the clusters both deltas map before it flips, so VSTOR-153445 has no RK for 8.0. This is the fix the v2 cover letter of "dm-ploop: fix the pio submission stop around cmds" said would be sent separately. Tested on dev-cl04, stock 6.12.0-211.52.1.22.11.vz10, dm-ploop built out of tree with the series on top of the applied dm-ploop v2: - a chain whose top delta overwrote a cluster of the base, both deltas reloaded read-write, and a direct flip_upper_deltas: the message fails with EEXIST, the device keeps working and both images pass ploop check; - an online grow from 1G to 2G, both deltas reloaded read-write, a direct flip_upper_deltas and then a write past the old size: with v1 the flip completes and the images no longer open after unmount, the ploop target fails the table with EPROTO. With patch 2 alone and with the series the flip fails with EBADSLT, and the data below and past the old size survives a remount; - an online grow, a write past the old size, ploop snapshot-delete of the base snapshot (the reverse merge of the library) and another write past the old size: the flip goes through, the merged image passes ploop check and keeps all writes across a remount; - the ploop pytest suite, ploop and qcow2 formats, passes. Changes since v1: - patch 1: drop the read-only and EACCES argument for the library from the message, the library reloads the lower delta read-write before the flip; - new patch 2: refuse the flip when the lower delta has fewer BAT entries than the device, outside PLOOP_DEBUG; - patch 3 (was 2/2): say in the message where the old stop matched and what it skipped, split the first paragraph, leave the loop with a plain break; - the grow test writes past the old size after the flip. v1: http://lore.virtuozzo.com/kernel/20261104214635.2063009-1-den@openvz.org/ Denis V. Lunev (3): dm-ploop: fix flip_upper_deltas returning with two md_locks held dm-ploop: refuse flip_upper_deltas onto a lower delta smaller than the device dm-ploop: fix the flip_upper_deltas check skipping the last BAT entry drivers/md/dm-ploop-cmd.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) base-commit: 1f21db982845109040d1feb279e9ee34f8e6f065 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel