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 3F5C68045D for ; Wed, 4 Nov 2026 17:15:45 +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 6A4HEUBG025271; Wed, 4 Nov 2026 20:14:31 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4HEUBG025271 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="yBePTHnW" 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 6A4HEOLR025244 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 4 Nov 2026 20:14:24 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4HEOLR025244 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-4901562b819so945919f8f.3 for ; Wed, 04 Nov 2026 09:14:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBxYFB+vpxC4yTOmz+dvLyFlc5b9o6PqSNktssSvK1dOseVNe6Ro4f+A8Q+7qG/5gAB3pXEQvA==@openvz.org X-Gm-Message-State: APuU4Z/AxXRRVOy1sbVL8anwEqIpgVPiWjD/3n+eW/FjdVKf3K81D68p KWi23frmgc4QsOmP4CIc03/O1GT9BmJdTRMUXsEiPl7v15HIeWTP+xyodwt6S+WAWuWrKO8cWNS LnMHlxQ26/OqNXUTk8ga0LcY6zEXyQyq1NvAk/9k01vqM0y5yELM7Aw== X-Gm-Gg: AYBFou2yZBLPGJK6fUbHhaKuZZMtMZq1ZeZQiZkdohMLvncuv1RFU5HgLgH/BXncQXt uPwJxZD4fCvpqIU8fNEgugawlbLX6nNbJnv1f/GqaaDo+3jYBLOyVbfX1uSOzyRykDUsAqcExdw MaLcw5Ih2fvJgha+iBS3aI9B7Al73zQZdHDfzjzekxKHRexadVNR71DETuguLYXzrd+AxgkQYbS yzUlQ+2Q0Z5UYGirUwnWkBoDGaNgtb9spH1nRgTSKT0gNu2pU/tfk6+VdXQ7ymOLZCRLp64UNDY 9hVRzf4ABQ9nVGSyrjsgHfmXiK2q8xPPicskKKV4Doagk62vg6gi3LwwRLK7DP3tb+AUUtva1/1 RmEtqmEbUNpQq2ckI X-Received: by 2002:a05:600c:4e12:b0:4a2:a9:ed87 with SMTP id 5b1f17b1804b1-4ac1765cf2cmr395733425e9.19.1793812464139; Wed, 04 Nov 2026 09:14:24 -0800 (PST) X-Received: by 2002:a05:600c:4e12:b0:4a2:a9:ed87 with SMTP id 5b1f17b1804b1-4ac1765cf2cmr395732825e9.19.1793812463638; Wed, 04 Nov 2026 09:14:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793812463; cv=none; d=google.com; s=arc-20260327; b=l6rzPjRLN+nrgqojiMZP6FrG7nfGBfi+Q5KWbJOgQ/pGsl8i60q56wtyMyXAdMrZpJ MM7zO22I7ozaL468dFBd280zJD6JBCgDflbhKl3LFlp5sZGnR/fx0F8z7RKgO2UswqEz p8Cx5z+d2RNx7KPMU/LVJaBEh8DZtbMp2pUJ+fB34+uhwcDjPiIL5yMo2vZXyb6XmDHp tTw1cw5tDVSERACs1m2WsGe8a6NHvNv9HvoOOO9qJdkZkyjuYSiRcd+cgGc3DYno5cX5 u16jnRUNdKTt40ymtfWDWJlzNIMLJ/nXK38qL5ethetnYPcMlmCc3o1iP/0/1POxO+V7 wbfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=W4rKZpBkA3v9yKErg4BCqcSSZLzSKS02454VAOcPVsY=; fh=wjIBJwS4A72E5Ce5VjfhniUGUVdfOyxDI2ywJwwowhw=; b=I5FIlwUtZVddGiFWECldlAc8jQMe+s6e/AUPpEI3rLILtl+N+Xy/LySgL7WKU8r6M5 MdI6EsFx05cGESxWh4qw6IU/Eao2W6RxcViMS9OE7FFQTM/cjCPS822WpdNnMqFSyruN rfUn24ofI3eh81z2ihGVuDNX+s9tPNLJ/lc8XggjWWe5SmGfNBcKMkP4rrN4pToS2VwL OMtKr5T2atz0jOejQdo5PMXpngs0KkQ9++FDbeXIeTnZgwF7bH8cA7lgd1LXukFu+rRk h/4w4KEz7qYeQNJeoPM44vYTVisSmcRzKzShjdvgymu4pGL5kTr5Jfoss++dAvccXmfO QnMA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yBePTHnW; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id 5b1f17b1804b1-4b43c36d5absi76048195e9.7.2026.11.04.09.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 09:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yBePTHnW; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=W4rKZpBkA3v9yKErg4BCqcSSZLzSKS02454VAOcPVsY=; b=yBePTHnW3WRl Z2came+y9A3RGZEaxIEskot3UUI/WbvKYqXlhi/qOrRkYxyVnhf33oaGQtVm3NhJJZDImn0EsM2Ir ADReBUGX3t9qirCjPk63t14FnlpAd4ZTPwYOlJ44WkbinSwmuq6km0a17/KhQ1c9IVKtaeb+MKIVz /rQZ/sKmTEzr1ZRRmB4Zgzye+216wLCVFCxXjQM7JvV/DEtTzZr3wakqVIOIo1pVrvgEfnROuj34V 9vG/XINToxGBe8dHVJx812cKK7LQNLtTOi6u/H7slDD/c0H28XY/coq9Z4XmcbRwA63ymIoStVKZH jT+KeM8rBY2mKmdGXzhYKg==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xOeV7-00FAiP-2z; Wed, 04 Nov 2026 18:14:22 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: "Denis V. Lunev" In-Reply-To: <20261103083642.130885-1-den@openvz.org> References: <20261103083642.130885-1-den@openvz.org> Date: Wed, 04 Nov 2026 18:14:19 +0100 Message-Id: <179381245947.2686233.5146578609245409826.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2956; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=CV7EYD7FXRes3qSxTW9UU/j5NxQkkysu2vpuZLkyWsA=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq62ftVaxFW7vaz3EmtWZoGywNnU5ydsQ+h0Mus eLismFJrpGJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCautn7QAKCRBRlgpH+WFc Kq46EACwcP9/oAaKh0gWSReeFM8LivLR7Yv2vYPLTTQQm9VwPB8Rn8MkJd1pqNqppdLdjct7/+J p/8lO5Bw6rdcHJhpVSAvwZpRWcjq6ZYOPSvj8y0LKYAlj5G7EuuLdStnEtNqDBmkLh/oqGGzPns goI2gQwGDl7AzC7h8B/B4B70Z8WnXSHJ7VFXQJe252YvJNBmy9YuEEhrYEoe9aNnyT+S74SrPG7 oL3ex+eJA0v2quKqaflowwo98nzFVcsqyzEpKWwoxHr8pV+dbWod5FsbaqcWboys4Sx2GfHJhKB lUPNWwZeMaUwYo1cO/xxfhLQwdRRPYk8t0WC/pfRJowr9EoX79JE1RMVs7n97KByFBBnRh+61Fu dQCpncLmIe5xsrMZG+yK/UckNjur4c9kad5k63mzwr90crvQWwLlD5KtbCZ+nSHPV5m9jtnLkzV U95MrL1YZIyXkt9tiwi/5t7zzWclJNVEhT8AyOCP4TX6svGuM4Ap9bsrIjk/CGp++TdKzpDlDVS zIqnT5tL0UHewUK3J+xv8dCTdXSFKMJB2nlXz3+I3eIDKpB39t6ztazepr/qFRXOqlDZe3lxet6 w06aqTeMQ6kQQe5DNvHcWVTHp/pfWgNPWM+dId8BMlQnhVRT0+D1rrAZungtHe4TdiCtL+kvBFk eDm8rtK5W5neufA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.1 0/4] dm-ploop: fix the pio submission stop around cmds 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 I won't apply this version, please send v2 with the changes below. On Tue, 03 Nov 2026 09:36:38 +0100, Denis V. Lunev wrote: > Denis V. Lunev (4): > dm-ploop: fix pio submission racing with the suspend and resume of a > cmd > dm-ploop: fix a lost wakeup of the ploop_allocator() thread > dm-ploop: wait for the ploop_allocator() thread before changing > deltas[] > dm-ploop: fix a failed cluster copy on grow leaving the BAT page busy What to change for v2: 1. Patch 1, commit message only, small: in the first race add notify_merged to "a merge, resize or delta index update". The code stays as is. 2. Patch 2, commit message only, small: - drop "until some later request wakes the thread", the stall does not end by itself; - add one sentence that the same reorder also fixes a lost kthread_stop() wakeup. The code stays as is. 3. Patch 3, code and commit message: - code: also wait for ploop_no_pending_prealloc() in ploop_flip_upper_deltas() before process_flip_upper_deltas(), keep the wait in ploop_postsuspend(); - message: "merge and notify_merged_backward" becomes "merge and notify_merged", both directions move the top delta. 4. Patch 4: no changes, resend it as is. 5. One more old bug found, not part of this series: the forward notify_merged stores the new file_size into the wrong deltas[] slot (details below). Please file a Jira task for it and fix it with a separate patch, not in v2. 6. Cover letter of v2: - "cutting the live image to the preallocation size" becomes "cutting the live image"; - reword "Patch 3 is the one losing data". Details on each item are in the replies to the patches. Below are the details on items 5 and 6. Item 5, the old bug. In ploop_delta_clusters_merged() the forward case stores file_size, file_preallocated_area_start and nr_be into deltas[level + 1] after notify_delta_merged() has already shifted the slots down, so the delta that took the clusters is at deltas[level] by then. With level == top - 2 that overwrites the top delta's file_size, and the next preallocation can truncate the live top image. It has been there since the target was added. > - the ploop_allocator() thread is not stopped at all. It truncates the > top delta while merge or flip moves it in deltas[], cutting the live > image to the preallocation size (patch 3). The thread can also miss a Item 6. Only a merge cuts the image to the preallocation size. A flip cuts the old top image to the size of the other delta plus the preallocation. > Patch 3 is the one losing data: a snapshot delete under write load is > enough. Item 6. Race A of patch 1 loses data too: a pio can read and write through a delta that merge has already released. Patch 3 is the easiest one to hit, not the only one losing data. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel