From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 6FCA9802A5 for ; Sat, 17 Oct 2026 09:36:27 +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 69H9Z99q027810; Sat, 17 Oct 2026 12:35:10 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69H9Z99q027810 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="DDLnnfbb" 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 69H9Z8gw027806 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Sat, 17 Oct 2026 12:35:08 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69H9Z8gw027806 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4a1dcc4f6f4so989955e9.0 for ; Sat, 17 Oct 2026 02:35:08 -0700 (PDT) X-Gm-Message-State: AFq9FYJ1IehWlDI/rAUihCVYZGJZOO7Xat5yi80sI5RErba8OXFdYRex 1Lul6lmKXFGCOe+oSEoeiPnr4Vtsqx7lHV3YvD+s3KUC0B7fsrY/TYiRW3J4eLKN6obAKnafJaI AE6gNM7SBl97uWgvVjCQGsapO9QwfSUNr2xRljMA0guHyf1DGTf0row== X-Gm-Gg: AYBFou1zgvJjzvf35jPKF++R8o3cMbyzP9OCslheYKIpklbD3MjzKHhyVaWfk0EEQSx gpIQgxq8W71VeznwirS1eS6tnF40JE9bvCZbPo5eOoqwyCgS68QXqsZqituzcI3C3nSr+ZmOKey ixJGEeoCNmilvCAmxSph4zC0jo6UG+wiovqc2XxPNk/+yxGgeUDsqfaVaiAClWqDSwrfY/1sDuW airto1dg1792yt4sxL5jIa7muba/T3WaztUSEPFHFgaP/ZsFxfzS/cx0FeXfO/yg5PAvPlQkT8/ UrGchil9Dan9NZNzOyuaEjJqyMgk7rRbFCSvUMrq8y1TXQT/Jsszz6czHSdgEB22YAO0/grreao nPbqA1vYNqeOVEGJ7WZ+So0GE9dsZ X-Received: by 2002:a05:600c:a088:b0:4a1:cd83:b23e with SMTP id 5b1f17b1804b1-4a1d74644a8mr54264045e9.0.1792229707530; Sat, 17 Oct 2026 02:35:07 -0700 (PDT) X-Received: by 2002:a05:600c:a088:b0:4a1:cd83:b23e with SMTP id 5b1f17b1804b1-4a1d74644a8mr54263645e9.0.1792229706930; Sat, 17 Oct 2026 02:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792229706; cv=none; d=google.com; s=arc-20260327; b=NZK4ax+huaJArznk333+D4LmfDA03+xvYJVtYhcbDivMvr2q2Y3Ofn+orDtoma9Lzt ItSuMH8H2qH4K86ln0vF9MvYhSK0jeAFJABEAVjNNXpaxjU3EFPiGnqACCKZBW5f3Fqg WlTiCYj/ZT9KkFAvm8z1lFR46Wo8JeApUW3lsrrSha07hztoqR62iCptT+lSTBqFhFQi YktN8+NK8rM7vuMfiwawx6sUT/r3ch/Sgb5w9G61K7H/mQymCvZAaaGe+5bNmP/O/Mu3 qzolmpie1heP+sp+H9+S+ikh6nxnV3Pl883OTrPxHcsN6LdhPwxUj+NvCkPFqyjNoafb CmaQ== 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=m50P9U5ob9pQlZrPMs4Y9DSI08TE3M5sQsIcEvdsUA0=; fh=M+TyAUhAp4+t7uzAVeqNdLHW5eNz2FQXSv4TjrRhpCk=; b=kFQJwifzsXzEsbSaaAWkUvPd09vtG5xMMhmG1woT0gB5Vxz1cbY5PUquUnU8a0lh1S QfVDMwl7/CjeYGx0MmFGSMmvjdPwTa/0zKptZT17O8zAkHhN7dNhZ/envhmNtvt627x5 JdweQIHZXGSIKQtmDDaKzmkgFD5L3+krcdaKJtpSVbI8FEhLV7P4VWDSvtWbVB1V66jH qFCg9OMqDsYU9WR7srh/rQFJXFblsg1T406jaykOSeQw0azRvZQ64xLecvooY6CN76Fg jeb9L6ULW+trkPNuZGSqYrpphbT7QM94fajCKN+fmaUCGOfjG/KR6qfGC86dZeM4Lvwl fOTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=DDLnnfbb; 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-48dfd521e94si9575275f8f.374.2026.10.17.02.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2026 02:35:06 -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=DDLnnfbb; 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=m50P9U5ob9pQlZrPMs4Y9DSI08TE3M5sQsIcEvdsUA0=; b=DDLnnfbb15a/ zUgy5zDiJtV3z8SoZQTHe775Ipiciw5DLxkugVj1XoSq6ISjmgwGoA+nE7KhYkZjJzXlIlt5XwwYu 8fYvVwgpjQxGq1LCXwrVrAdPDCdxvXPhBGgqVV/z9iVbk0keRyBQCeCSc0IxIeodNeGljGLvtcLtN naIYxqvOYglP+Ak3pE7xAh6KNozDuqeOuZLS1U4Ma6veJAJH4IE7Krd52n0vlVj60E1UY5mAZnv1o qLEoC2lz7c4kVF9zSM1ormmk1j5yLBzm2Ymcl6YPPVU78IV/ZULhu4uRhV5D4CkIiwB1N2NKex22y Hhvhwl17euE/W+LoLaqDIg==; 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 1xI0lE-00DF7U-2k; Sat, 17 Oct 2026 11:35:01 +0200 From: Alexander Ivanov To: den@openvz.org Date: Sat, 17 Oct 2026 11:35:03 +0200 Message-ID: <20261017093503.771224-1-alexander.ivanov@virtuozzo.com> 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] dm: don't inherit bio-based table type for targets without ->map 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 A table whose single target has no devices inherits the live table's type in dm_table_determine_type(). dm-qcow2 and dm-ploop open their images by fd and never call dm_get_device(), so loading them over a bio-based live table makes the table bio-based although these targets have no ->map. The first bio then calls a NULL ->map from __map_bio(): BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:0x0 __map_bio+0x197/0x1c0 [dm_mod] dm_split_and_process_bio+0x1ad/0x740 [dm_mod] Inherit the live table's type only if the target has ->map, so it can run bio-based. Otherwise keep the request-based type, so table_load() rejects the mismatch with "can't change device type". https://virtuozzo.atlassian.net/browse/VSTOR-150573 Signed-off-by: Alexander Ivanov --- drivers/md/dm-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 954bbc338bce..a12b1cbe4336 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -987,8 +987,8 @@ static int dm_table_determine_type(struct dm_table *t) int srcu_idx; struct dm_table *live_table = dm_get_live_table(t->md, &srcu_idx); - /* inherit live table's type */ - if (live_table) + /* only a bio-capable target inherits live table's type */ + if (live_table && dm_target_bio_based(dm_table_get_target(t, 0))) t->type = live_table->type; dm_put_live_table(t->md, srcu_idx); return 0; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel