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 5E4678017D for ; Tue, 3 Nov 2026 09:09: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 6A398JMK003082; Tue, 3 Nov 2026 12:08:20 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A398JMK003082 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793696903; bh=5IfC4oSyicuUPHdoQ0b5P+BWnrn0rUU+uHODMS9JKSY=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=W9dW3ttHvLLzwNvSsrrNEenOereZvSIaMgHpnn+P3CS+RSIs32ypU5lGmBxA8Gdal 5ba70AfvzXTXmiF2tjI25plvP1QrYDbV2p2XmDrIVSrC+AO1vHrZJFJ2u3DewLN9hx eNzyLQHtEciQ+bc+PGaoyVuEzMGefEJZy27u1FAw8MnKHmgMjyfvcfJk+gWJP7lxcG sRJa3h6/ZNo/XdoTf2d0z09WSJUTgnN05oSoGl7Oc3kW0kLzqhU7FfFICkbhzuJZHC cPU2hevKL7wzf0FzSicXxhzTfQ3DlFHvuie37GQWP24ot5NkEeFFaRL3LD1fhhOEh/ VXdtStIZ5xX9w== Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A398HUY003072 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 3 Nov 2026 12:08:17 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A398HUY003072 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="MfhLcqH3" Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48df02b91f9so267248f8f.1 for ; Tue, 03 Nov 2026 01:08:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBz+qZIVVuisYbvq1wI8XIDpaMdBoVabHX8MYwbs7egde5/Bb3IYW8LHe/nOZlA/bHXujz6Z1w==@openvz.org X-Gm-Message-State: APuU4Z/cNZGgfD5ZQ1TQPTbTkKAeiyzI5aP52aBzoCF7Cq4YWXrkICVI Gax2vWWQky5tRDS0JD7WCzqP6HigyIeHTcujJ5TaZey/Fk9jmVW3FIfFHheM2feOrflG3uBdD/9 D0Nmcfjm1oJ0BKpI/4R7kdEKZ6LlshOKZkLoLUw20d9+YtAPeVKwzqA== X-Gm-Gg: AYBFou1H7ZJ+3ecbjN7AYIw+6I+ZjH1j/XJmLEVROHAzzTHBTShOTjECr0i3dNWjbdS 7GRB2Z/ockJIeXTGqij0x6ehWO/n01oxgoA+4fLDmyBVX6db6iSW2EM1EXFXU0K5ejGM4iLae3p bVAYMVqwXj7ijzC03A4tC7Z+nBQv+WXgt/oajlJFiZpJNAFO2QAcElWl/1Egid5hNReccEZ9Rz+ Ou23/H+Mormkjc3h42KTjiX1G7F2L3ok+nkAvNvjebKL1mPKHZIDe4DUWUhA11IuGlSe8hFbOtk tgRN9YZxzg== X-Received: by 2002:a05:600c:c87:b0:4a1:efbe:529c with SMTP id 5b1f17b1804b1-4ac17567fe1mr293618075e9.12.1793696897177; Tue, 03 Nov 2026 01:08:17 -0800 (PST) X-Received: by 2002:a05:600c:c87:b0:4a1:efbe:529c with SMTP id 5b1f17b1804b1-4ac17567fe1mr293617425e9.12.1793696896731; Tue, 03 Nov 2026 01:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793696896; cv=none; d=google.com; s=arc-20260327; b=l8o2Ix1aNHFeMAGdLzW0oCIOq82BVVZtAYxU45ZwbOhTXVDgcAyru8ec6epUDkcYb7 bZk3NrZHxUwt1v2GOUU3cLIAZoHJU5I2jgbM9Il6PTqr/fpuWLpzo+OpGv57pjcBDuga n7jFvNAUQMfC06h//yq+68c2Gti5/Vd2yy5eBnaky9wWo3s9nhgRfW6nLjQvtN7Uv7d4 jpP00sq7U0wk6R+mrOTaqT8RwiTDcywzz7Yw2d0QeG/PWVaVlgl/DhyqiXjglkTj4d/Z qOZxBrymTuqEDI3Dwg7TyfAnfxC1OK/CAlpWUOMKKSFKFGymfzAvftgwhdtOim9vATqm EydQ== 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=4CWArxK2PGs8yTJ4xgIQ95TxMkdgVKcAvjavrYbHusE=; fh=eW2N9gNXU+35ZwBOTobRthf/Nxi3sw5e5La1STNs6cI=; b=Bma7otUxv0Ep+f5GjW4zxj+DWejjdeX0KExom1PQPJz8g43DEuCpXur4ruE2xnFCqb lVn+ElVqFsoBnPeekHFsPKAP1iwFFz2BWqsdM9xlFXzKXYq1TWTZBpa5kH8o/DECmJ2/ QkspOAzpYCXm2dGOzd/XhPu4ZEckxdMbPhy6JXBswM2MNNXbW1mZyqZp85yDj9kYfVox n5VVjeWMD55Qd58BKz2piJZ0cQVM2A3B1igqVFcizv3SuZgGm2BJPXK70xKnWT+O9Q1J Sq1SiDItY2A2jBQUkeifW9jZK6/95272XoaunGRsQigIZbTVj0NVZAvC1oaJQ1DpcNIM afIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=MfhLcqH3; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 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-4b2acded21bsor1789215e9.7.2026.11.03.01.08.16 for (Google Transport Security); Tue, 03 Nov 2026 01:08:16 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 as permitted sender) client-ip=2a06:5b06:b600:300:c789:8bc5:fa8e:d502; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=MfhLcqH3; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:c789:8bc5:fa8e:d502 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=1793696896; x=1794301696; 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=4CWArxK2PGs8yTJ4xgIQ95TxMkdgVKcAvjavrYbHusE=; b=MfhLcqH3u+04Yh2+MyGy0zkxhdi65AxBMm5tB0074iu1F7+adfWN3pp7YiH1sg74FK h7/rT0j1OSbur+mBQrPK241cm1+s1TEFCcCk5BxFqPvAKS7YL+kNEEqdekCAnHKL3Td8 D1HB5KLnu8u4YKYUXl3C2KNn1kJ/bdzuy4BBCgdjTE8AqmkCm2PvPYtQHjAJ2oJ++s4O Te86pQMK8XGidhxvUPELzHmIasEqhFP/+Ux5PLBh6DSn52pzAm2bWNRi7RTn+iBdBGre qDalQOSTmOGnu9sz82q0yUtjvCn4lk3HNX/9Fh96K5bhBCTsu6RFiCoC2griRRB2qQ0D 43pg== X-Forwarded-Encrypted: i=1; AKwUvBz7QFmXaLW0XHQS+Q6ujJyiT6/xADNjBz2hiNcztIBEsFdfvApvh1Rq92K0nCpdRVc28t0Scg==@openvz.org X-Received: by 2002:a05:600c:8b01:b0:49f:c5aa:9ef4 with SMTP id 5b1f17b1804b1-4ac16fa4f73mr299852465e9.8.1793696896181; Tue, 03 Nov 2026 01:08:16 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:c789:8bc5:fa8e:d502]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b2a96fc933sm45453365e9.11.2026.11.03.01.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 01:08:15 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Tue, 3 Nov 2026 10:08:10 +0100 Message-ID: <20261103090813.166986-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-qcow2: fix merges not stopping the users of the images they change 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 Checking dm-qcow2 for the same problem showed that a merge does not stop everything using the images it changes (VSTOR-153049, VSTOR-153050): - a backward merge of an inner image pauses that image, while reads enter through the top one. A read reaching the inner image as the merge starts oopses on a NULL qio->ext (patch 2); - SEEK_HOLE/SEEK_DATA walks the images with nothing keeping them alive, so merge_backward complete frees an image under the walk (patch 3). Patch 1 (VSTOR-153051) is the counterpart of dm-ploop patch 4, an error path leaving state behind: after a failed refcount table relocation, allocating writes past the old refcount coverage fail with EIO until the device is suspended and resumed. The series does not depend on the dm-ploop one. Tested on dev-cl04, stock 6.12.0-211.52.1.22.11.vz10, dm-qcow2 built out of tree, with a test-only kprobe module widening the windows: - on the stock module, with 4K clusters and refcount_bits=64 so the reftable relocates at 1G, a failed md page insert left every later write past 1G failing with EIO; a seek went on with an image qcow2_destroy() had freed; an intermediate merge oopsed in submit_read_sliced_clu(). None of them reproduce with the series; - the ploop pytest suite, qcow2 format, passes. Changes in v2, after Sashiko's review: - 1/3: a note in the commit message on why the error path does not unlink the pages from the writeback lists; - 3/3: guard the walk with a per-target rw_semaphore, taken for write by merge_backward complete, instead of an inflight ref held over the walk. With the ref every inflight ref switch waited for the whole scan, including the one starting a backward merge with the top image paused, so guest I/O stalled for as long as the scan ran. The seek reproducer and the qcow2 pytest suite were rerun on v2: a merge now starts while a seek is held, and merge_backward complete waits for the seek to finish before destroying the image. v1: http://lore.virtuozzo.com/kernel/20261103083708.131379-1-den@openvz.org/ Denis V. Lunev (3): dm-qcow2: fix a failed refcount table relocation leaking md pages dm-qcow2: fix backward merge of an inner image racing its reads dm-qcow2: fix SEEK_HOLE/SEEK_DATA using an image freed by a merge drivers/md/dm-qcow2-cmd.c | 28 ++++++++++++---------------- drivers/md/dm-qcow2-map.c | 18 +++++++++++++----- drivers/md/dm-qcow2-target.c | 1 + drivers/md/dm-qcow2.h | 2 ++ 4 files changed, 28 insertions(+), 21 deletions(-) base-commit: 09eb9a82fe872048d082391415d1cdeda2ac6879 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel