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 7FA338017D for ; Wed, 28 Oct 2026 14:49:29 +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 69SEmD4h020820; Wed, 28 Oct 2026 17:48:14 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SEmD4h020820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793198896; bh=s9zOjN3FZGbb5mJaMSc7CTCpPJyDXK/N28xCKPG/9R4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=DrqPwNx6IZKx4qfkztCrvV1Mmk3lah8sUbygGuqjw/cVk/vpKUmxywPPSoj7Fm2bJ Ezt5T1JOgwmzymVV7m0isdf33fMHrwmpAB0aT6iu19nDV0weCFbRUGMsnUAJl9/HB+ 5JAzMC4OvmiMULLj3iUFKZDSOmgxNf/g72N7jawxvojOR6imPxvNtiSPAAi1ky8jp0 KElSfhGe+/EEVUrD2zAPd5q6vQvqnsIkcpEWjEZHq1jfleT+PgIjBdarNcmNsL/qlf WXvnErsr4X4GeKm3Jvi8Ew4aVbUc+tD3tACxV/Cqv+WNAvH29YkFA/nGWGu12rByZQ 9KxmIRGUHH0dA== Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69SEm8t2020806 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 28 Oct 2026 17:48:09 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SEm8t2020806 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="PbZqsmgi" Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c37b2763f1bso116817466b.1 for ; Wed, 28 Oct 2026 07:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBwSe0ZxFjtccekg6EwRraOmH+zmLDIDkUpSODuY/Fn1SKvfvj8akwlkxJTI/l4lHpvDVH7EQQ==@openvz.org X-Gm-Message-State: AFq9FYLdCnGNOD/iz5MH7VHWOaGgv3Rea5aSyuE6KB2uIZIhvZB0bIQN mmHRMP3MwMzE/I5SfcFoPS1bBnZpTt2ELbWe47hXiagKOJPAQ6Q/1Kn8pHEIhCv67Gku3lp22Mr omEbhCECsFhslp6tPvN7u1Wvybwi9sTWaqxFTPlDPuuZi8TlrTQPMtQ== X-Gm-Gg: AYBFou1vaDiZ70pOb9/Ye6vC3UStreA+9Ia7BQSrS57nAPbzmV2HQA6rNGtBLteHUes TLxlckfB2fcQ4QRQGi9EyK9szHO8sJraw0m9d1uneEWpstOcPzhujCXPsX/vfAUvhH9Lbxc7/k1 Y7NCUE6+DbmlF5uS1UtylVpZ+oVXmOLbUjdBJ8mM8CozO7XEl+sfagXCJeacbicCfyQqW0kgOsE 4yKlaOHVqo1hIlUMzg65IeZ8Qm5JZdMxsI9omDeh/smoIMQqB58GgVkHngdyaiPYaJKd6jfOYLw Ynj8+PirhA== X-Received: by 2002:a05:600d:4121:b0:4a3:59c9:a758 with SMTP id 5b1f17b1804b1-4a96836988amr57753015e9.32.1793198212534; Wed, 28 Oct 2026 07:36:52 -0700 (PDT) X-Received: by 2002:a05:600d:4121:b0:4a3:59c9:a758 with SMTP id 5b1f17b1804b1-4a96836988amr57752195e9.32.1793198211900; Wed, 28 Oct 2026 07:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793198211; cv=none; d=google.com; s=arc-20260327; b=Jij5j3LDNiy2+CpHLebNMSPlxd3a9FDyKJGMEcx90Imwt9G8GvS+VBe4orRkaJHDst RKzQqipi75WDI9jfotF/e6iP/o0YOp5Wn8030Acx/cQ6gQMVIGJEM+Qlul6rRZSMnzvV 1gYGMqsRmVMYpIxGOTGBYqmur5s6hU7MKeSChnFKyyefbnMsYten3oO6Bh6mLbjiDxKY 7dP9M2SOTBkE6u9x8ePkslvsGj6SUkECRRWGPwLnlO6nseeFfugAJph8W32ihEKKHaNz 7ywdXkjcj35DrNzChal9zkRO7isvryWDUWGtEYSNwvrRyfUtvDBNsT6XHfhHQGBEQ3oV 9MJg== 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=U5kZQmRmIHvhvM+ZEL7Bk3N2Zm9y+KPxXSPW6PZjAUk=; fh=eg7LajPFZ1NiTNs/PQiLagjhwhdIMGwuTgN5mAMOsjk=; b=p6QblwZ8iF6g1miJZEaRlIIyjnaeUyzZxiCNmUFnU0udMTtPAQqBdv3ywm6t3ZyYvw Tx0r1e6bpjCuxSUzSBojVjyqboSwQBaDY8Yc7gBVUi4EztnCkbuzbNGWzDgoL3baBrAm 8euZqysmOA0hJ4Xy9eFPO2ynlM5O4AgdJ6qA3eFNZAMA9VUOl0EjkMCdhl2s/jpBMZkY BgYcZkPnFL9VdFsEKSGSmwvJSqNuNgWArVqdKHaN26PAVFxzPZEplckCRa3LLujRtC4v Yf5I5i8WV3YD+7ZFK0qxUo4JiqEkyQ2LwELn/cphCH5OaHtoEanoEAEuIYtN1fv1dYdQ JCfg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=PbZqsmgi; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf 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-4a90c939659sor7738395e9.5.2026.10.28.07.36.51 for (Google Transport Security); Wed, 28 Oct 2026 07:36:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf as permitted sender) client-ip=2a06:5b06:b600:300:2c3:d099:6fb:56cf; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=PbZqsmgi; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:2c3:d099:6fb:56cf 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=1793198211; x=1793803011; 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=U5kZQmRmIHvhvM+ZEL7Bk3N2Zm9y+KPxXSPW6PZjAUk=; b=PbZqsmgi5UpMQkDAzsE0Jm6Oi8JsaCmL+sfq8HYA3OoIJ74OPr9GlXZhsrJlzINCUX rmMRKgvDCA3vwwzWs9BGl7IghY9EcWlzTAs0SRZ93Q4OmTUvWisZxiQrjAsP6gB2TQlG me3zL6GeLIzD0XCeGvoXO/Qk9aaVkwlI2l55OZT5Dz9nFcpgLNl0Fc2gyxoKUJBoJuy+ pJpnJKFU2GwAESr+vQDs8tlME0OAgaaWgWgGiqWYw50sBJDwOUJFZIbBY0dGj2yjHmF9 Een1luGD+5/p+v+oCOJAH20KHuT0SueTP+ZGU4Uwk+iCJdp15qUWo6qaTo8q/0/GDKNe avyg== X-Forwarded-Encrypted: i=1; AKwUvByfprxwlsJa/TdFkVioJiVqoPZ5TM1JHuQiQq1Ln9Cep/VD1/ox+aYpg2Vd3/Gr37MdZGb6CA==@openvz.org X-Received: by 2002:a05:600c:4e90:b0:4a7:7f3f:6f8e with SMTP id 5b1f17b1804b1-4a96179c513mr51623985e9.0.1793198211368; Wed, 28 Oct 2026 07:36:51 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:2c3:d099:6fb:56cf]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ebd4d8dsm30321335f8f.36.2026.10.28.07.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 07:36:50 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Wed, 28 Oct 2026 15:36:44 +0100 Message-ID: <20261028143647.2972030-2-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261028143647.2972030-1-den@openvz.org> References: <20261028143647.2972030-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 1/4] dm-ploop: fix freeing the wrong clusters when a BAT writeback fails 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 When an index writeback fails, ploop_advance_local_after_bat_wb() gives the clusters it allocated back to holes_bitmap. It passes i + off, the virtual cluster number, to ploop_hole_set_bit(). Since "dm-ploop: make new allocations immediately visible in BAT" it does so for every mapped entry of the page, including the ones copied from the local BAT that this writeback did not change. This marks as free image clusters that are still in use: data clusters of other virtual clusters, and also the clusters holding the header and the BAT, since small virtual cluster numbers fall there. Later allocations hand them out again, so a guest write can land on live data or on the BAT, while the clusters really allocated for the failed writeback stay leaked. Free the image cluster the entry points to, and only for entries this writeback changed: those differing from the local BAT, and those the local BAT maps from a lower delta, which a COW replaced. Fixes: 6ddad5a4d226 ("dm-ploop: Add ploop target driver") https://virtuozzo.atlassian.net/browse/VSTOR-151979 Signed-off-by: Denis V. Lunev Reviewed-by: Andrey Zhadchenko Feature: dm-ploop: ploop target driver --- drivers/md/dm-ploop-map.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c index 48466435dd19..34bf6487107f 100644 --- a/drivers/md/dm-ploop-map.c +++ b/drivers/md/dm-ploop-map.c @@ -868,8 +868,9 @@ static void ploop_advance_local_after_bat_wb(struct ploop *ploop, if (success) { WRITE_ONCE(bat_entries[i], READ_ONCE(dst_clu[i])); WRITE_ONCE(md->bat_levels[i], ploop_top_level(ploop)); - } else { - ploop_hole_set_bit(i + off, ploop); + } else if (dst_clu[i] != bat_entries[i] || + md->bat_levels[i] < ploop_top_level(ploop)) { + ploop_hole_set_bit(dst_clu[i], ploop); } } #ifdef PLOOP_DELAYWB -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel