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 115F180474 for ; Wed, 28 Oct 2026 12:32:56 +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 69SCVaKG019954; Wed, 28 Oct 2026 15:31:36 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SCVaKG019954 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793190699; bh=oiS6675BiG6yeW5PkOeeNNlELcYvSKi6fq56ZCCaNqQ=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=k6dn0IVFnxbICAZenGuUiEtNzT9Kb9Qvom5rp0848WljzEzUd0VN2TcQI/ud4UV08 hvvpS2Cx6kyPFDSgAPtqyswkZGWI/ICfTXpg+w/yeZZCowJlriji97H6SI7hLQYia7 EZqoYMFugjm2FCQ9CS+cxCpK4H7fNPnXOhXY0A3D+YWvv5Q1ehVTP0mDYha0lnyjWI zNQeX6ipqzwjnUj6xDcUlcwp8gAFWIzJoz65ab66IbkTn1cEFdkUpDvJwYGtKvcAfY tCezK7NCN32QtjaDaP/9hoQranb5mjcVmCaw4eJhqY1Ths/9Z0RE4yld1FH9IqNJPg EOivPw9N0EvRA== 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 69SCVYGf019946 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 28 Oct 2026 15:31:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SCVYGf019946 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="J1tPBf0F" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49febef74e3so13433825e9.0 for ; Wed, 28 Oct 2026 05:31:34 -0700 (PDT) X-Gm-Message-State: AFq9FYKiSR495zOpfjAFtIoLme1zJQIosBZxenhfrCuNDe86B8bra2IB 4sLfawJW7l7WzbuMdcEID3z2vZ4aR0csETNgRpcSICSfP1pBY84J0mDXYjUB8i1j+Ph/V+JUqmI JRt53wIwKUYnj1Ek36wWsVPMHUEOc7q+izxhmi7Yzt5cCYa2pRlpO3w== X-Gm-Gg: AYBFou2egb+gDc6Quem/Biyf5TL1G513exF1Z/h+GIv6bG62HGJdUwjLT4YPmhpmVF6 8vMCCEAQ4qNg+FTL5vD/wkbExQXmSs3XMaHvGVf96qzaZ0swt9xE2dDrDNgJkEJaQ7gcWv2yC5q AqhMrot4eMrwoMDaCm77bFzRwNSOjzH3NpR1hBwwZ4Ny1FfU/5WQG7ZtCmiijrJUfEhzCYGkbAF vwKQvCybjk7xkXL1idel2uOqAVMUs0oxkBTfcYnaOmq2zsnm/mTr4L5+oNOZD21fVdR8/pgIpZx KveV6CX7ag== X-Received: by 2002:a05:600c:1c0f:b0:4a7:72b1:c8bd with SMTP id 5b1f17b1804b1-4a997b0517cmr33989305e9.15.1793190694216; Wed, 28 Oct 2026 05:31:34 -0700 (PDT) X-Received: by 2002:a05:600c:1c0f:b0:4a7:72b1:c8bd with SMTP id 5b1f17b1804b1-4a997b0517cmr33988825e9.15.1793190693522; Wed, 28 Oct 2026 05:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793190693; cv=none; d=google.com; s=arc-20260327; b=IlOy2sLgcPV7pFos2tnPprtipPOlURCRrMnoy7JpCNku/A/RkMdrcEKmc++ux8FSt/ 4x6SuFWNaEUor6bQ9uLm9E/OapYrX+CS19BnV1a71zYxg/q3FsUDUPMC4i0+snFMNGo8 cKlgXGkQAJXIOKd4C2AvxFl9n6h8jJVV+fqwYGFtOJ1LNv/Vski4DD/gwiAI8txDAqig 0dDdFyRWtBIaEmlw8p2HiWrBURPqAaLR9puB8IoTTWaPez3SB6hZpDRIOHWYocHSTw2q IZ6U2UZvzrdH3cNyFvHoBJ9oM6WAinMO7ktQkyVVjfWpy3QvGaapu5mBD1XN2YsnzhrJ ubsw== 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=paeb3de5Fz9/33YLyV71r2Netd+WPnEv68MW6bk++zs=; fh=Kr/R+ZQiC/tid3qUs5C3px+AHPSuipOrrdrDcZfSlMY=; b=hrgitfsoivojA/fpTC9ZncgY1cHLKnekwR9Ip8KhEUC8YPd/B+cAOa7W54QS/bfgay /bwE8ba9gi1elIS9ndVb1mfGzvy0bGI/QuUMp9rgWj4KM379vDooUl1Nhkdwiq+xjIAe r3USsYnXZiYkqvdsKhOxo/62G/zdp77x6S6zsYc2OIRIlLTf/55HkgrwDdVPiiQwolhv nydRUWo0J8JL/htsc17aV4ssOZ03meGAsrn4LVdUXj4mSrIUFVOxp9sHDGtCkbaRe/YN 6wv6vpYlaP5g1ix9qUjFXKNJ/0dX+PT4gbW+bzKOP0QQiA3CqWV2RV0P4TrWJPxMQpp3 +SWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=J1tPBf0F; 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-4a35a096beasor14013335e9.3.2026.10.28.05.31.33 for (Google Transport Security); Wed, 28 Oct 2026 05:31:33 -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=J1tPBf0F; 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=1793190693; x=1793795493; 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=paeb3de5Fz9/33YLyV71r2Netd+WPnEv68MW6bk++zs=; b=J1tPBf0FAdYj8NHcFhmYxNim0hoAut2ibMEjCBnz2yFIA52QBXQF+4Nly/gfZAYLry KTU1XLQCFgSEeudflVDbursEhx++/+/nfeov65s2Wl6wTJP/gbrpl8CHZOxzxK9/8MB4 +nxwngaZqrTTH1blh3Y58JSSRx62byEGWn+3BYMzY2WXLD0ysbgSTqFjkXB9wCGRcV6C eMZaJBLlduqvK5qgbHm5EezFGj8N5yjpf//1SMbeDUdaRveLpH6qbdJYXuI2zJnrMpO4 UFjSYj7fAdTmSaqE441ujnlOAXPFRiVIFEGpvEIf/LXUDjqZfxYuGoCZbgXkA/qwuiq9 CGaA== X-Received: by 2002:a05:600c:83c4:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4a996f75149mr38443505e9.10.1793190692913; Wed, 28 Oct 2026 05:31:32 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:2c3:d099:6fb:56cf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a9733d48b4sm48869705e9.0.2026.10.28.05.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 05:31:32 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Wed, 28 Oct 2026 13:31:27 +0100 Message-ID: <20261028123130.2828357-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 0/2] dm-zero-rq: fix a crash on a flush after ploop release 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 releases a device by reloading it to the error target, and ploop_dmreload_zero() (VSTOR-146886) later reloads it to zero-rq while the file system on top is still mounted. A request queued against the previous table waits out the suspend and is dispatched to zero-rq on resume. For a flush this is a host panic: the flush request has no bio and zero_clone_and_map_rq() reads the operation from rq->bio. QA hit it in the vzctl release-disks test on hci-8.1 (VSTOR-152097): sgdisk run by "vzctl release-disks" called sync() just before the reload. The vmcore shows the queue's own flush_rq (REQ_OP_FLUSH, bio NULL, end_io flush_end_io) in zero-rq, and the original empty PREFLUSH bio from ext4_sync_fs() still waiting on the flush queue. Patch 1 fixes the crash: the operation is taken from the request, and a flush is killed like any other request zero-rq does not handle. Patch 2 completes flushes, discards and write zeroes instead of failing them, which is what the zero-rq reload is there for. It is split out because it changes what the target returns, not only whether it crashes. The error and multipath request-based targets do not look at rq->bio, so mainline is not affected; dm-zero-rq is ours. Tested on 6.12.0-211.52.1.22.10.vz10 with the module built out of tree, by suspending a released device, starting a sync or a blkdiscard on it, then running ploop_dmreload_zero(): - stock: the node panics with the oops QA got, every time; - patch 1: no panic, the sync and the discard fail with EIO; - patches 1+2: both complete, nothing in the log; - the ploop release tests, ploop and qcow2 formats, pass. The new tests for ploop_dmreload_zero() and the reproducer above go to ploop separately. Denis V. Lunev (2): dm-zero-rq: fix a NULL dereference mapping a flush request dm-zero-rq: drop flushes, discards and write zeroes instead of failing them drivers/md/dm-zero-rq.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) base-commit: b499efa17aa9fb8f20512d1831d1cb61b22e60d3 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel