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 6D0E280BB3 for ; Fri, 23 Oct 2026 13:21:41 +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 69NDKFlI024837; Fri, 23 Oct 2026 16:20:16 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69NDKFlI024837 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="x61Tw4gU" 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 69NDKDIm024821 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 23 Oct 2026 16:20:13 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69NDKDIm024821 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48b027578a4so827636f8f.3 for ; Fri, 23 Oct 2026 06:20:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBw9M/KJ914zitdAqeGzd4jFVrWlkWbpQLF6tU4QXyarJ5Q33nrwDzbopgov+sDDKeAtQS5Q/Q==@openvz.org X-Gm-Message-State: AFq9FYJaMD000bSJtCdbZwqSItQ52aue6ljwLrx2oT/WNuhH3T4qZt1r t/RfSFxqX2TnfJ43ADLVMgfDRS3E4EO8eNqMDFDfVE6azGBTiGHsTeTmMg84pI/E27TqOLzPkCG RooK+Ta6ZGiqgHBB41JTDd55pPOB7RThOvFjgKTzITgtbkMd19OMbAA== X-Gm-Gg: AYBFou37FQG2vtsqkYJd6DUEPxaE90a66g0gSTaRCW3Qs+ki6j5rwXojlBsmQ0qIjh9 NU9KnfhJfGwpScmHgGwAH82ktt0gXczt2t7bURvE08dn68x+77zfyWvJ+zZI48NXgsKI1KBSerH zf91fje5UkvmOKqsaiEY5MZLt5JJay9z3JfnmafS/+ZpR5RY4PRhA+uEp+DfKISHPe8Os33Ku8d ZuwfRF2TS8ueRK5qEeqCVXRdJXIdhY1WYfe4pCnzf+5EfcmXCcC1Js9dhh68e5NC5rFnrsN1M0i V/ULz+yQSU1V7E8xsNKHqbsaCsO2QAD+6ChalaMcHFaPTJBXhWDQ1cruB+FBSmzyCw8IcoQzRAL RNKIYvrHv0a5GTg4zvXgSCsHGM2op X-Received: by 2002:a05:6000:2502:b0:48b:f92:1f67 with SMTP id ffacd0b85a97d-48e385b1f88mr3988324f8f.21.1792761613456; Fri, 23 Oct 2026 06:20:13 -0700 (PDT) X-Received: by 2002:a05:6000:2502:b0:48b:f92:1f67 with SMTP id ffacd0b85a97d-48e385b1f88mr3988212f8f.21.1792761612696; Fri, 23 Oct 2026 06:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792761612; cv=none; d=google.com; s=arc-20260327; b=j+AYJBqdJRAscnMPvvNxnt25K501XPIgmvn8VO1ukJIhXYqdh3875SfKRblnIzgSyZ u6/uj7QssXpIFAZBX8jEHyIAYnwva4UFpNBIj8TUuwRhUftU9MHfQsfeyDo3XOG1Cxy6 vm70hgfHTsu3oIHH03d8Dc5ds+etpvyFKb53+fB9POLo9pjebNR7fG7UsORr55Bf6Zvh Cej1+H4EXCQA8iXE16vHVlUE708ra63SA8Foxsl/THhjFLlNqcn5R//6Chf17h2kEPFk OhLQzND0EaeH11NFigYbCi5bs7xcDJOzjNOZI2KadpO1Z961oEU/cwcUvzieKT8Qeipd YY8A== 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=TGBDnuCSghFJVJyy5wUrjx+aQn0RpzYnLLgh/MbprPc=; fh=1MEQxOGYABaQPNQS1Ckioh0rrUOwgCYjd8t5csgx5as=; b=I44uQiwEHTSSHbSU2VsidqNYKVwTFHRYfgQ8mZYsxbX2RCTEA5ODQ/nEMQGrxaB+et ubRwLd6UASu+EwO2+A/uUaenWWMOMHZDc7QdFjDkob54HDy20pYUtlCqamwtuGrfZR5C NqU4eHAINJSgFtO1iU3ZLkyR5CfY2SViy3+ngyvtkrDjnzInetNOZTKokgPCJ3beoXP6 vM3BNhBWdfKm3T7tyKYGrHmJ20rSKxb/bVCbt+1dQcCKlCBQtbELndFTVW8p0Yc2/Dzv 0lMbp/hAryv4VK+0zPB2XE4Xe1BQfzzp5lvBixtmgkBH/5qTOeqK6UwN/0CsGnM2ObVm WGFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=x61Tw4gU; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@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 ffacd0b85a97d-48e380656b1si3738983f8f.148.2026.10.23.06.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2026 06:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of alexander.ivanov@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=x61Tw4gU; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@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=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=TGBDnuCSghFJVJyy5wUrjx+aQn0RpzYnLLgh/MbprPc=; b=x61Tw4gULD4x VeP8jxSveha2GEn346OKg3kxwKIreYlZJFLnREOsOcYg1KYz515qqq6pFZwZYDZcbD+Ol9GfxVqOf DzVCRsobjwbfaLYoSfNfFKuP1yc8BSgpaG18CHcpsTTs3q8Tkz7lMGrADXtmeXPr4X33gyprWGjKl LPY43gigOrDDbXQrs5p8yAaxCom/tmT1bkT6wilAhvpJIFz9xwTmR5kScDf5fSK2w1YOKthsKGGaT HOyDZhfLO8gjeoeCltnh4T/fGNSb14MbCXxGfzbFVaLQXQ/GHHuZjehKmyjI9YlKRmrtB3w86jEQz hpVD3z/pnBF1ODberuPnDw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xKF8D-007iDn-1v; Fri, 23 Oct 2026 15:20:08 +0200 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Fri, 23 Oct 2026 15:20:07 +0200 Message-ID: <20261023132008.2304901-3-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261023132008.2304901-1-alexander.ivanov@virtuozzo.com> References: <20261023132008.2304901-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 2/3] drivers/md/dm-qcow2: fail writes to a read-only table 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 bio_check_ro() only warns about a write to a read-only disk and lets it through. dm-qcow2 then allocates clusters in the top image although the table is read-only. The header is not updated for a read-only table, so enabled persistent bitmaps stay marked consistent while the image data changes under them. Kill write requests in .clone_and_map when the table is read-only. https://virtuozzo.atlassian.net/browse/VSTOR-138887 Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Alexander Ivanov --- drivers/md/dm-qcow2-map.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c index 54b3a345f927..26fdfce09aa7 100644 --- a/drivers/md/dm-qcow2-map.c +++ b/drivers/md/dm-qcow2-map.c @@ -4506,6 +4506,11 @@ int qcow2_clone_and_map(struct dm_target *ti, struct request *rq, struct qcow2_rq *qrq; struct qio *qio; + /* The block layer only warns about writes to a read-only disk */ + if (op_is_write(req_op(rq)) && + !(dm_table_get_mode(ti->table) & BLK_OPEN_WRITE)) + return DM_MAPIO_KILL; + qrq = mempool_alloc(tgt->qrq_pool, GFP_ATOMIC); if (!qrq) return DM_MAPIO_KILL; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel