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 76E4281377 for ; Mon, 9 Nov 2026 19:07:43 +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 6A9J6PVc002866; Mon, 9 Nov 2026 22:06:25 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9J6PVc002866 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1794251187; bh=SXyUMlB/z1pjinhVDnvmFzsyi/A41W4dtjDoCvqIl+k=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=ZN3r71EQdynA9MHnmWAiDcLoqot7aSTzgILj7w+K/CyU9crWp28fAB/L3eP7UHrP5 FtOUDhubwNROEBEqPnJDbDIaBQOL7lYeLQff3BX/ceonpdwZU2zUGkpP6sJQEd4zu9 YTFvRplNJ05hFT35bXOXCbUUsHuJ3JOVsqdN+epnSOTnRFEMwqb7ZDazq0/zGmLyWi hLRjBPJ7DXOaFIlXiZoAn3wyKPfoE5gcD6P7ZeUtIZznA9SX3e9Jqer+d2A4yNMgFa KejEosFfYtBGJn2yuP4xsvbg6/N5LWk0kR3IFKFKRe+TQ2Bpfx4lvQSgeUOlC7vk6X KB7C0OPtMPQug== Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A9J6Cb8002846 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 9 Nov 2026 22:06:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A9J6Cb8002846 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="roOdIPDs" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4a77c1cbd15so9586365e9.0 for ; Mon, 09 Nov 2026 11:06:12 -0800 (PST) X-Gm-Message-State: APuU4Z8IF9KUQwSfgoAGHcyOD8N8Fl3Dh7TTgxQKbJ2tJmZFQVZNc4s9 EY6F/IYqpZu1kQx+yvF14tCX7ndsc7kJ36GftV2k/n30kppucpVW83w9X3YffbmU18CE8xgN4wQ QLxoe56ejcPVU/dDy86rKfKJr+35PFOvQtitsdNZR0Yvdw4SKZtJn0Q== X-Gm-Gg: AYBFou3P8FC+blJIDIXYk6yhaDgeIG57XaEw90QO5VjRde2Jauo1b4zRNrRVC7DWRSf ofjqwU5cEcCKkh7i6ZkYsz9IJ40Muy2vZJDmTNKRCLI+Iezqu3zGzGF/E0cWdxJudJAAGNEIja8 7tKfD1Q6Qv267Ii/e6HgqqDZVdVbhMbOL5blNwHQJ5r4tFkSfYTcVpnSfALNgSf4r1lgRSefC2F eziDb9AB8ISvjQOmHlY41E92behHIQ00WlyKblSb5X8LwLSjVtUcoO683mhpOqgcQXE0Mpz5Ike Li6cjIvAhw== X-Received: by 2002:a05:600c:6214:b0:4b5:d95c:2378 with SMTP id 5b1f17b1804b1-4ba02357d71mr2856285e9.34.1794251172109; Mon, 09 Nov 2026 11:06:12 -0800 (PST) X-Received: by 2002:a05:600c:6214:b0:4b5:d95c:2378 with SMTP id 5b1f17b1804b1-4ba02357d71mr2856075e9.34.1794251171696; Mon, 09 Nov 2026 11:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794251171; cv=none; d=google.com; s=arc-20260327; b=XPicQ7AwMzTXDoTQflsWl7G4M0KjgzVqbQh5qKTWzfWudWZMuUYQ27mUcDCfXZLLqN d6NDB90crqQUBF9ou4YBvxcsTi9fUt6JIg8MEiemezH4nS3DQ4TNygscTsMjgoQSBZYy oXL/OOca7mq6fYIJDcPMLuzXft9jalNgTF92cJ00p5O4blVYYVCQnpSbVKSbfhvi3o/m 2HK0gco22zBWcs4NcxR/7ckX3t/OHtI3/eAbFpSHR7VoJcjIulMXXhgstc47ttBz976L 2sJqjSz1DbBLHsJCMn+cr4kyuZAqps2w7I5I9lyj2qH5/vrnRRgNKR0xW2mtr5msr1DS 6GSQ== 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=BKuAIMVg6ZlxSWHZyxg0CDRxMPeAvU1bWEJUfRUkcQc=; fh=LUVQCdF3j0nWkqybXIUUvDalO2P4EK/c3ur9yogw5Ic=; b=Xry66pRW3x3Nx/yMKlOMT82CNz6tEDaqcVM0ftKo1oaded6hYTDa+IMXig0VOeSsqx OB+xmA/0aoXWHwJR4PUdIuGqvMMjh6f6T+nNHXECuEBmhqGrS2OA6xTt+dBDY04HK9Af G9yj8EG4OjKlVP+rq9xbmFkIGBCzD7NmTuYtYCrvcsxLkiCxN4x0rfOLv+hh5qWswMez nE/4WBhf5FPuA3W740rKhSKEWepG+M7Ind+eQeCaKjBeiipJKcleVaYH5GXTjXCuS5jL aFIg0oqT2c99QkqA4a2hMuIPjHCzU3VlsJ1a/k44M061Bc+3YiEJ6zau0hwtH31pLoGo u8Tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=roOdIPDs; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:dcbf:4b53:b63f:3b41 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-4ba01daa39fsor769515e9.0.2026.11.09.11.06.11 for (Google Transport Security); Mon, 09 Nov 2026 11:06:11 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:dcbf:4b53:b63f:3b41 as permitted sender) client-ip=2a06:5b06:b600:300:dcbf:4b53:b63f:3b41; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=roOdIPDs; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:dcbf:4b53:b63f:3b41 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=1794251171; x=1794855971; 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=BKuAIMVg6ZlxSWHZyxg0CDRxMPeAvU1bWEJUfRUkcQc=; b=roOdIPDsLIMltj37BuDdUIIlb5ZHCIH3XTqzQO8KLZFwzjVKTFLZ4eIoUxQDSRtitu rjB5G5O3hEkaIYelVMDc4wtJuCG/a5F4ZTuNCY+8DLPpJWwxmwKEZl7APGQJfn0leSso mV02o+eNYQtPozwhzgXvYF+axTGpYogHe7wITIjVxVV+YuyKkqnDen3rB5lVqKYK60uc VPHw/UubOsvMqmFosxbckOZBaCnjTL8St5LLuI8MBXyCaOvlfOqH0oMWRxkp/R+C5Gda jX2OsRzlto9iScy1v4+FFPZiuJCw50wMVAdTpYH0nkyn0e+acxdatR90zF8I2bk1uWki Gw4Q== X-Received: by 2002:a05:600c:8b09:b0:4a2:1a:a116 with SMTP id 5b1f17b1804b1-4ba022c6c50mr4295055e9.0.1794251171205; Mon, 09 Nov 2026 11:06:11 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:dcbf:4b53:b63f:3b41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01fba476sm10162755e9.2.2026.11.09.11.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 11:06:10 -0800 (PST) From: "Denis V. Lunev" To: khorenko@virtuozzo.com, andrey.zhadchenko@virtuozzo.com Date: Mon, 9 Nov 2026 20:06:03 +0100 Message-ID: <20261109190604.1850504-3-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261109190604.1850504-1-den@openvz.org> References: <20261109190604.1850504-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 2/3] dm-ploop: fix pios stuck in md->wait_llist after a failed BAT update 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 ploop_locate_new_cluster_and_attach_pio() and ploop_process_one_discard_pio() set MD_UPDATING on the BAT page while they prepare its update. A pio that needs the page meanwhile is parked in md->wait_llist by ploop_delay_if_md_busy(), and only ploop_advance_local_after_bat_wb(), at the end of a writeback of the page, gives the parked pios back. When the update fails, the error path breaks it, clears MD_DIRTY and MD_UPDATING and leaves the parked pios where they are. No writeback of the page is queued, so they are never resubmitted: the writers hang in D state, and after a buffered write every later sync on the host hangs behind them until a reboot. An allocation fails this way when ploop_prepare_bat_update() runs out of memory, when no free cluster is left, or when the punch, zero or preallocation of the new cluster in the top delta fails, e.g. on a write to a read-only device that needs a new cluster. Take the parked pios together with clearing MD_UPDATING, under bat_lock, which every caller of ploop_delay_if_md_busy() holds, and resubmit them with ploop_dispatch_md_waiters(), as the writeback completion does. The error paths of ploop_prepare_reloc_index_wb() and ploop_grow_relocate_cluster() clear MD_UPDATING without a drain too, but they run with pio submission stopped, so nothing is parked there. https://virtuozzo.atlassian.net/browse/VSTOR-154096 Fixes: ddf38fa44df4 ("dm-ploop: fix and rework md updates") Reported-by: Denis Genov Feature: dm-ploop: ploop target driver Signed-off-by: Denis V. Lunev --- drivers/md/dm-ploop-map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c index f0569263622c..b49281691a01 100644 --- a/drivers/md/dm-ploop-map.c +++ b/drivers/md/dm-ploop-map.c @@ -1750,6 +1750,7 @@ static bool ploop_locate_new_cluster_and_attach_pio(struct ploop *ploop, struct pio *pio) { bool bat_update_prepared = false; + struct llist_node *waiters; struct ploop_index_wb *piwb; bool attached = false; u32 page_id; @@ -1818,7 +1819,9 @@ static bool ploop_locate_new_cluster_and_attach_pio(struct ploop *ploop, if (add_to_wblist) clear_bit(MD_DIRTY, &md->status); clear_bit(MD_UPDATING, &md->status); + waiters = llist_del_all(&md->wait_llist); spin_unlock_irqrestore(&ploop->bat_lock, flags); + ploop_dispatch_md_waiters(ploop, waiters); return false; } @@ -2026,6 +2029,7 @@ static void ploop_process_one_discard_pio(struct ploop *ploop, struct pio *pio) { bool bat_update_prepared = false; u32 page_id, clu = pio->clu; + struct llist_node *waiters; struct ploop_index_wb *piwb; struct md_page *md; map_index_t *to; @@ -2092,7 +2096,9 @@ static void ploop_process_one_discard_pio(struct ploop *ploop, struct pio *pio) if (add_to_wblist) clear_bit(MD_DIRTY, &md->status); clear_bit(MD_UPDATING, &md->status); + waiters = llist_del_all(&md->wait_llist); spin_unlock_irqrestore(&ploop->bat_lock, flags); + ploop_dispatch_md_waiters(ploop, waiters); } static inline int ploop_runners_have_pending(struct ploop *ploop) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel