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 2558A8017D for ; Wed, 4 Nov 2026 21:47:58 +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 6A4LkjPr027157; Thu, 5 Nov 2026 00:46:45 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4LkjPr027157 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793828808; bh=RrcBzqOksZqOTcv8YlQUTh5Upawlg1646iieHEDr1bs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=CAAMfaKdKTTpoqMNZhW9YLIHQfpyqax2LPjJSbTUTDg3Gtsre0bE6kdFd0ppwm6NB w8lFdQiLrX2NGoUxYtQBPKzv7ATsxmDM+aEJ0Zf8Lh/+P6/DhZoGVG+YslF06omWAd 7K79Ggh+9Yr4ChqTnm+BxsLuwHo2T2PAWF3gjIDdckXaHJGjlT1NGEsaHgHRy9tmEf CP/Px4Wee0Hd3KQaQulMkHV1G36niFYU+detFQv5OboTyuFge+OG1xZHv35tU5PgAP ptA3jfjqwY7SkjaYx4Pl20emGwyoIaOQc3uoEnv+jvAmGZP9clMuplNqm6mbQZymcR IWe6PEgHmKYwg== Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A4LkeN5027142 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 5 Nov 2026 00:46:40 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A4LkeN5027142 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="OSkGUnag" Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a20e41008cso10249075e9.1 for ; Wed, 04 Nov 2026 13:46:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvByHf/2v+DUW4NeWznP8eQOUJ9WbL9lw2Fi6A7MNiO+0DzVVnkazNZqHWrcByC6p/vhJScxfgA==@openvz.org X-Gm-Message-State: APuU4Z/5BDnE7un9aWO0HQeiuFe+dVk33wI4mmx4fSNA1jc6t2jdTVEo UFaALuKq5Tt8bnBYybH63xInn1w+6iROlBlFwDJvLIGoLGzdytdsASZzJ55ScW0cLGDSzfzHEcu ly9PDFCP45EDJLhkjVUrH2mdgwssXm8vVwH7K1YK3kYJrK9+m11n64Q== X-Gm-Gg: AYBFou05QcG7nAwIjHkUKooUyH9i3rGb70xb52fmYDnBYgrESbLVX8FLbq3lkx2UwfD iTKj3Th1V91zhyMp7L8VIVOewRedELwQAZNFWrYYnKlu351GJxG4FH0uIQlN0HN+l2PKnKxpg4r 5h+NAwRSswh8+gXNsCQmQC4PfszTP9yBqPGqQQTZyTbgQRvr24nCaqEhuTzJCTYxveLETwAcbnO G7TBAUhMDXulDZE5Ymc+8OCHFDZf7Sd/VeZoyuPBpbKUkOyzlZ4kWSrjxOAVMiXabkP3d0HS/tk 4/FyJ5wufg== X-Received: by 2002:a05:600c:34d4:b0:4a2:d7e:5ccb with SMTP id 5b1f17b1804b1-4ac182dca99mr427588895e9.15.1793828800001; Wed, 04 Nov 2026 13:46:40 -0800 (PST) X-Received: by 2002:a05:600c:34d4:b0:4a2:d7e:5ccb with SMTP id 5b1f17b1804b1-4ac182dca99mr427588765e9.15.1793828799496; Wed, 04 Nov 2026 13:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793828799; cv=none; d=google.com; s=arc-20260327; b=Ih+NYo4qChEWXwcUGomE2CDZymPMThKrG1DGFQucNtrqRlzuKNtArdH7vrgNfHdAsa DIhVaH/COS4tMGRIBf5PBATKGBeNsVw/tqjuPwS5UUyanEVuzkaBOIxOafS3tShKVsCu S6uy5pRpmZQQygzblDZB1shl+/3lgx3xAFCtF855c8vU0zrHTBmLsSaot7KbM4Y7dyst ZBtmqg52oqYdqdPI47xE9W66c/OqZ7xriAsAUHHGy0KLck/73aIye0iGQdrnj+CT3eF4 WHxg6NdxFbkPajK3faguuQexJsFqwiiOa57cwb6MYBKsXx4K/JEpjl8G/tNKJrQDS012 ++dA== 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=6z0rqje+phzCzhNyU6vSa+yS8SxZIyYRjEYOfj1cXqY=; fh=9TGFVBxOE/yKYmGV4I5KtnwWsNH/JCas6UTQji/o9cI=; b=m5j21fEkpRZ9trU4bbIeyNraasICP4SvuojF3TvRyXhzZBpEBL7xbIBxjgJtE4j7zz VoEStnGJYrMO9IyxaIbPzVBhNvLNNAZqjrBNlOMGEiCVYo0gX+/UVama/TakzXwjbfBZ Xyjxa5J+6nO77aYGJ7brlfOYoIVyOXy9N8JjSRWkK/wxtfXEuUvVwaFxBstgwhTlcOmD +mpG7KgrFkKVVnuQSTgCUDGE6xf8XiiHv8JIqBJOS9KJ2+SHNsI22ibeRIDyQqYaevSx sRbylJgo0624B9Wo/sExdWozQaaOKLqMgWfDPFu73tGHW3GRMnhJAlSijTXAgfzPoLEo zMmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=OSkGUnag; 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-4b43e251c6esor7179455e9.17.2026.11.04.13.46.39 for (Google Transport Security); Wed, 04 Nov 2026 13:46:39 -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=OSkGUnag; 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=1793828799; x=1794433599; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6z0rqje+phzCzhNyU6vSa+yS8SxZIyYRjEYOfj1cXqY=; b=OSkGUnag2Z7JxtuVyqT6izbwEaKltFjrKWcJnlYUQVFSFnhyppj+iWw9KKYzXWXMWD 6SiWX5etzKbWgSFrc+PG+hZdT7PZGXTClUQuUfcyz2Y4b48eQ3KJ41eDuZ84YlPweQ3K NfYSkndabSVK4u4/ypBIlYdVdx4h+0pBGYj1G75WqLxIG7y56pJFPia9wDlUl8Jy6oAZ GUedDXci2hBup0ZxS+QNd8PHNggEfTgLb/cdnjfFHnkbxh7d+iqsb9IgV3fDSj5NX8NH U53k8kRCXuJBrb702Bbwy705A+PDQiopF0bgAZOVzWWVwFDC/2+LmZ4ZWJrmzLc3kl2K BXxA== X-Forwarded-Encrypted: i=1; AKwUvBwAvRis1e1NlNNtId4CddeUtpiF6HMgiBVxOQU1y8OMaMWw3bw0Ni27U96KIB9qPXl5Et+i+w==@openvz.org X-Received: by 2002:a05:600c:890b:b0:4b3:8529:eb27 with SMTP id 5b1f17b1804b1-4b38529eb48mr85127035e9.27.1793828799087; Wed, 04 Nov 2026 13:46:39 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:162e:5a6e:fd46:18b7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b56e2ae72dsm24489635e9.3.2026.11.04.13.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 13:46:38 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Wed, 4 Nov 2026 22:46:34 +0100 Message-ID: <20261104214635.2063009-2-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261104214635.2063009-1-den@openvz.org> References: <20261104214635.2063009-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 1/2] dm-ploop: fix flip_upper_deltas returning with two md_locks held 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 From: Denis V. Lunev ploop_check_delta_before_flip() takes the md_lock of a live BAT page and of the matching page of the lower delta before it compares them. When it finds a cluster both deltas map, it jumps to unmap past both unlocks: the cmd returns -EEXIST with the locks held and interrupts disabled, after freeing the page of the lower delta with its lock still taken. dmsetup comes back to userspace in atomic context, and the next pio touching that BAT page spins on its md_lock for good, a hard lockup. A flip_upper_deltas message, with both deltas opened read-write, on a chain where the top delta overwrote a cluster of the lower one gets there. The ploop library does not: its reverse merge clears those entries in the lower delta before it flips, and a device it mounted has the lower delta read-only, which the flip refuses before the check. Leave the scan only after both locks are dropped. Fixes: 0d4b4d0a20a9 ("dm-ploop: introduce per-md page locking") https://virtuozzo.atlassian.net/browse/VSTOR-153445 Feature: dm-ploop: ploop target driver Signed-off-by: Denis V. Lunev --- drivers/md/dm-ploop-cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c index 45fa4fe7a45a..d6abbdc3c7e3 100644 --- a/drivers/md/dm-ploop-cmd.c +++ b/drivers/md/dm-ploop-cmd.c @@ -1146,11 +1146,13 @@ static int ploop_check_delta_before_flip(struct ploop *ploop, struct file *file) d_bat_entries[i] != BAT_ENTRY_NONE) { ret = -EEXIST; stop = true; - goto unmap; + break; } } spin_unlock(&d_md->md_lock); spin_unlock_irq(&md->md_lock); + if (stop) + break; clu = ploop_page_clu_idx_to_bat_clu(md->id, i); if (clu == nr_be - 1) { -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel