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 D63E280E7E for ; Wed, 4 Nov 2026 18:43:16 +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 6A4Ig1Ys025999; Wed, 4 Nov 2026 21:42:01 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4Ig1Ys025999 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793817723; bh=yg86Izae+P3uTfFNCe6fc6JeLP/Zt2Dd2xUabAMDzc8=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=aeqm0UnyVy5dSqgxq3oY6IiuacEq8MoOpjJRmBquDqgZVbYSHEqpTBgNzRrRG0j3P DJSFW/ScOFJ2L11zhyxByRQHGHVLFEQnvb180q5yjHWGgdupuBRRnVlf8w/gAGXwxg y6a9cmA9XnafHSUCuRsljyBA7xhCiqzMQLQlauHqVUhT3kwnIz6jjrdgQL7lBQZcki S0NasjlydE1h0k0zzyy6nfD9j9y5q6E65lY1BaNMS9ChR5LjhII5TGvqRqlvtsZ24Z lz0mTOFzQAXdA5V4IJ9P02d4tG+GgeRmWaJ2iHxVfcgjg/1nfSIN/1LGbQaC7xFMMG hdw/fkrfnQ92w== 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 6A4Ig0nR025995 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 4 Nov 2026 21:42:00 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4Ig0nR025995 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="biH13IOu" Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c498fa2d96cso100234266b.1 for ; Wed, 04 Nov 2026 10:42:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBwOBs3a9suZAHF+pfy/hbCR1o/K+akCrKUyY/yH9hbvvdzPTj0eOY4smce4nOM3Mg1dmCLiDQ==@openvz.org X-Gm-Message-State: APuU4Z9G9449Enat1v7QBMPnlrUmrEPIWma17sY5zbCNbt3ey8+xYLap +74vFEa7anQIUvPHH3BtPmve/lgvq+Z4wwuY6S0Ixx/TumMwXoK9hgmxIGqjc6g4K+KFIhnJ3Hd 7rjWZMbfuJ2U2eYGwZxXuCAypfFhf2AHOTt8bcPptBPMwR5iVQ25YNQ== X-Gm-Gg: AYBFou1AD5tl/Ni62zeZmfaIfNN9AeJSsPcxnLbwasLrXktz4vhIFf5J31CVezv8yC7 XllOUJViFL8soo4Pq9TbYA6+djyOQHkQxEn/ihCqa8xrAFRGyb29mixo81vX4ALNDI/nNds+wu3 Y+lSh9kIWBOwDoVxQ6Re/GmeGl/n5gT0Yfmpf4m/HiVMXzhv9qkXkV6nNLd5U/d4TGFKFvL8sCM a70DxclPs5pGCBqlvSSmq+cT/775yqT03ILvJD7ds/bnZmA1BWkCtY18g9qLZ9bp9jT22TRCKUR HPudVeE36g== X-Received: by 2002:a05:600d:a:b0:4ac:aae6:6400 with SMTP id 5b1f17b1804b1-4acaae665a6mr290380725e9.13.1793815269727; Wed, 04 Nov 2026 10:01:09 -0800 (PST) X-Received: by 2002:a05:600d:a:b0:4ac:aae6:6400 with SMTP id 5b1f17b1804b1-4acaae665a6mr290380365e9.13.1793815269254; Wed, 04 Nov 2026 10:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793815269; cv=none; d=google.com; s=arc-20260327; b=E+G4UfB6QzEyXUirWQ7aKtF7M6Q0rBJDyHvEe4eKT/TFTbjvzQug3ohGNJgUXlvc8W sYwgbPhuVheEQ95ZYR/Sm/KDDfvRi9ExW6CryDNQXUDg52U2GDMe1Fwc8yAWPL2pTOjI +Qc+f/wsVwxLEGjLLgTEOyCkqGI7vIBVfPrLwFdsU4Rbtfo05pnV2JmcdhyomOkTz2d2 2vrOXf9RF7X4mU4TU3h0GkuwKUuLUKwpX4/0oAzHAatus3jtgnM23jFkJAojiqveCH8r buxM6lbLw2EFJPVUc+k4jjTik23YbCSBX7nU3QugsT3afWSm1nG9/i17azHPcpS4cGDN jLgg== 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=t/vu8GQDsFPI+1IaeXCBinQUUYEXGz9kluVs4B+4Flw=; fh=b99Z/A0l7fmzIC73YHC3ywOcbBcchH7MGpDT4zoSRLs=; b=FgKEXrlPpQA3u5AupQ6g0YNRND/Ad/8/ro+ID2uUnZScJBO19TsXIgA4QRjKA0i2lw 69k+7cwSaqjQSGGLbCnKcBK5xnRVsK0t1IHXv2+MUX0APP87bgF97wxa9lPKzg4TaORh B7QJH9gRdf+nml0zOuLLNxQhaYPz8F4jdxuU3R/Z599YBFOZcAsA/vqwCjkCBo9VKIPK S89agIgCEnQ1XfjOPx7uiJKnWfggAqWcG+34VnZdLOpJ6VhLuLm+Rra8RkR6iohzG0/R 6lMVtv2QNxOst7vaZeqC667B3N3FINV5EfP4BMuYtm/X/Gdkik86D2VzqOpR7IP7tgEB KnJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=biH13IOu; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 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-4b43da9711bsor5545585e9.9.2026.11.04.10.01.09 for (Google Transport Security); Wed, 04 Nov 2026 10:01:09 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 as permitted sender) client-ip=2a06:5b06:b600:300:162e:5a6e:fd46:18b7; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=biH13IOu; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:162e:5a6e:fd46:18b7 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=1793815269; x=1794420069; 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=t/vu8GQDsFPI+1IaeXCBinQUUYEXGz9kluVs4B+4Flw=; b=biH13IOuHtLL5rhnqHN5RCn0xrppsn5Nx6FIWW0/HUwQ+NGuN+8ZM/+BfzqkJDM4I4 fKrMuGxwQPd/1OsC1H2/vMo1D02+7t/0NnRR3yjOdop/sNA/n73Pn5wSgur+TAD4ar/0 HUcMGwMTsKsNv5RyELlskFTQnIDnOd2t6vprQT4oqWhSkbbDurWhtl6I0N+Dd9bV/4P1 b4X+2l681uVrzTRz3w3OUE1Rq5WlvaILCk81PVHsSenUQyJCTnqWQxtBo5PhCTvpAb6N e3DKyWiWE2aQ/c9POa7m56QWJw5jKxB6RFtpsyTGD3fhuthUDGecE62Xi4rMjvXAWpjq wHuA== X-Forwarded-Encrypted: i=1; AKwUvByOG/M5cqI5CzCz52y/uqx4S8VlQP56ekbzjJEAKa+HHgaRvOrJqlce9VzozPpkzIp+swfY6Q==@openvz.org X-Received: by 2002:a05:600c:4704:b0:4a3:12fb:1ef1 with SMTP id 5b1f17b1804b1-4ac18992a21mr345185305e9.29.1793815268529; Wed, 04 Nov 2026 10:01:08 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:162e:5a6e:fd46:18b7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48feda20521sm5050716f8f.53.2026.11.04.10.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 10:01:08 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Wed, 4 Nov 2026 19:01:00 +0100 Message-ID: <20261104180105.1807820-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 v3 0/5] 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 starts without pausing anything, while reads enter through the top image. 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 4 (VSTOR-153422) fixes a seek that sleeps forever after a failed metadata read, which with patch 3 would also hold off the next merge_backward complete and every target message. Patches 1 and 5 fix the refcount table relocation. Patch 1 (VSTOR-153051) is the counterpart of dm-ploop patch 4, an error path leaving state behind: after a failed relocation, allocating writes past the old refcount coverage fail with EIO until the device is suspended and resumed. Patch 5 (VSTOR-153421) fixes a relocation failing on a valid image once the new reftable fills a refcount group by itself, with 4K clusters and refcount_bits=64 at about 511G. 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; - SEEK_DATA over an image whose backing device starts failing reads returns EIO with patch 4; - an image with a 511-cluster reftable covering 511G and every cluster in use: without patch 5 the first allocating write fails with EIO after a WARN, and qemu-img check then reports 513 errors; with it the writes go through and the check finds no errors; - the ploop pytest suite, qcow2 format, passes. Changes in v3, after Konstantin's review: - 1/5: once the header write has succeeded, the error paths only return -EIO and leave the new md pages alone, as they may already be dirty and queued for writeback. The commit message says so in place of the note; - 2/5: "no guest writes" in the comment, and the message says that starting or stopping a merge of an inner image now pauses guest I/O to the top image for the inflight ref switch; - 3/5: the message says that merge_backward complete now waits for a running seek while it holds ctl_mutex; - 4/5, 5/5: new, the two older bugs found in the review; - rebased on rh10-6.12.0-211.52.1.22.17.vz10, Reviewed-by tags added to 2/5 and 3/5; Andrey's on 1/5 is dropped, as its code changed. v2: http://lore.virtuozzo.com/kernel/20261103090813.166986-1-den@openvz.org/ v1: http://lore.virtuozzo.com/kernel/20261103083708.131379-1-den@openvz.org/ Denis V. Lunev (5): 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 dm-qcow2: fix SEEK_HOLE/SEEK_DATA hanging after a failed metadata read dm-qcow2: fix a refcount table relocation failing on a valid image drivers/md/dm-qcow2-cmd.c | 28 ++++++++----------- drivers/md/dm-qcow2-map.c | 53 ++++++++++++++++++++++++++---------- drivers/md/dm-qcow2-target.c | 1 + drivers/md/dm-qcow2.h | 2 ++ 4 files changed, 54 insertions(+), 30 deletions(-) base-commit: 95ab11e2c57e8468412ca586d4be8cd75b6bfbf0 -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel