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 E2ABE803F6 for ; Tue, 10 Nov 2026 18:57:19 +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 6AAItxdP018143; Tue, 10 Nov 2026 21:56:00 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAItxdP018143 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794336962; bh=meIQ9c5q/r8IfmqK7hsliqVpTuSbi5tXBxNemmjWTHI=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=TuKrx+ihvOiwBuNt4pn5vFxkLnVexSQnQ9ZKplFcMfN9+YDMA5HdM1Xm65l6YVBrr dWDLGy2n+uEcRMeSGrw6RtBz4/QW9khJKQO5BfS3cqpp6ZFzskNMIOsHQ6ED0pzsz6 c48xItxvSPhdF8URw5zMzRvTJuDIgW1qrHzeO7D9kLUiMTWHnqZfWUunjzYeL0+giO 0wGcdLjPw8Dj+PvxCc2vd/W3b6wzmjJ3HW5BtAl4C0zBeriQOCR2zxcixgKPhaQ3mx Umnt1N+KOoH7e2IzI9BU1lp/+YG9xS64b63VvkwvFJ35cFm2k7hFMthb/HvnDcownm SrUjecejJIs0A== Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AAItwn1018139 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 10 Nov 2026 21:55:58 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AAItwn1018139 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="ozn5VHhu" Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a77c1cbd15so17897145e9.0 for ; Tue, 10 Nov 2026 10:55:58 -0800 (PST) X-Gm-Message-State: APuU4Z8GKO4/DFNBeaTlboL8o2zx8DIn7BUueE4PzSk4dfs52NZcOffn foY2RPm/V2ZfMR0+m73MdQs8Bj3/e0KpuzVwDdRdciyMZpueAat/1y9dwGW+v0X9hXK+W9JlUxn d8PA2TRqGY0rajlX/mzRDVxGphPapHiq3c1zzjpD+TCyZu9wmvRGb+g== X-Gm-Gg: AYBFou3CTBe9aMC4x8c34QOokMvFWHX9r6OzK8OTY01MbiEat3agmHzVdSQxVeocHIo gtiR94RFML+iU1mfd3SWAvB7mV0SF2n8XlFqHHJUgidGibARGxKDNBPiJ3fP7+8a51b6UuvIwjF x57sJaZy9greWhRRWfVC4ZKWscoyXJjdy37RVSUGbFzL5GaGTCujgw6mJQBRhwqkYysaHaVFH0k a/n9MTL+ijBY1EpLQjSk/yoy7x7bMvb+YPr9tGAAJKobEgMpi4I7UYm06TJ4albwiBQ1kg+SiSC AsFdCvqUhw== X-Received: by 2002:a05:600d:4121:b0:4a1:c5eb:b445 with SMTP id 5b1f17b1804b1-4ba0939b0damr435435e9.35.1794336958537; Tue, 10 Nov 2026 10:55:58 -0800 (PST) X-Received: by 2002:a05:600d:4121:b0:4a1:c5eb:b445 with SMTP id 5b1f17b1804b1-4ba0939b0damr435165e9.35.1794336958087; Tue, 10 Nov 2026 10:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794336958; cv=none; d=google.com; s=arc-20260327; b=iYILUAVwouIbQKTneI6yCsMahf3Bkkfr9Nz+961QAjc4gXBqJUNuQnqv+rs9YufUhh J+t5RoNyxMtWaCVerMM3OdXVyF4a+8yONbfHt66NB4Vq867d18uRKzXfkq8T2jCXu7tj LQUbOxujReH+8odD4dAyZX2Phw/kt5UhjfbwNeVABSKlpfwaWLmaVrKLIWxuaUVpaxwm 0f9rbD4j6Z3EmvkaIwmMcOp8OrOFgArK8rYtqBSat9sqSSI2S7e1AnHM+Wr0HxDQre7m wRkiFXanoM6z8r346wZMCXP02iBZKrvef4kTC/oC0BhQOKc9y0/X0A8S/fZzsaQmciUl xbqg== 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=Nz7WaehlTkyBeizbfWF3cO4SbdOPCNpjEFg+GM4tcFYmHNumqff2EStMADyBgPhobQ ZFK0mQi/ndBSrQuNemQEWKe7DxQgdeSUhoPNIASv6oJZ+/SJxm5QhF/zO0gRXzlpSYNt b7Pb5Ms863HvssCAFePgJbc/MKj8y4qKZlAT8fK8LDVb6VYfvlygQ+PeTxGPjQTMff06 C3g6a3YKmZSO0JRHAjLpUvLMphRpxgkDDW1J1Ii0liWFHHQ6VzTetdCCXhSC2DzivtlN tTydM5zT2T5DCT5xOqBthyVMp20245XqOMSohqe6Zy64Jjfn2ACsvoBoF88XiZTZwgtl RPcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=ozn5VHhu; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af 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-4ba01ffbc8esor6567985e9.16.2026.11.10.10.55.57 for (Google Transport Security); Tue, 10 Nov 2026 10:55:58 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af as permitted sender) client-ip=2a06:5b06:b600:300:4f78:6441:d0f1:22af; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=ozn5VHhu; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:4f78:6441:d0f1:22af 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=1794336957; x=1794941757; 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=ozn5VHhu3sx/deGqH7PShiMg4S2QE1ebLXYaq33hCP1ka/xTNaZvImNI/zSKwlRoFU OB2G55dQ/cMc0CqVS/CidgmlFluPelbrmA449iMb2yOi2tpWNars1MtNGwaJNDd1Bfhh fA8jB5NyZqq5Xl3ECdD9oNkALvoPi4XUQ5SBOeMzLt28gmObte2OIKnVz31zRCtitTJ3 JN3YTItCoTTnsrJ9krO6wWLRUS+/L5a8kBwojgVnqaX7BC0YChnC+xTLYQHryMqYLK1f QmyP8jbm5fZ1uZBcEfzuajliFwf4bAr3gpT98BYvHd2kDzoQt/Rx8ahTbJ625WdDioTU fDXw== X-Received: by 2002:a05:600c:6218:b0:4a2:1a:a116 with SMTP id 5b1f17b1804b1-4ba091a73f1mr1543515e9.0.1794336957559; Tue, 10 Nov 2026 10:55:57 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:4f78:6441:d0f1:22af]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba02387ed4sm55207475e9.4.2026.11.10.10.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2026 10:55:56 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com Date: Tue, 10 Nov 2026 19:55:51 +0100 Message-ID: <20261110185554.2970417-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