Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796063229; b=D5MsimgeNtikAZc3xWTKAMmMt9q0jeSuO+pQkmzR7k+TYiAm8hvuSeGO9pNS0Q376/u/ tBoqZKnMVH1d93E2qTIV3BAlJ6m4euPIbx6sQ6erCDSn6Vats4NoWF/kQcVwb6EOYfhMP WSYenXF85tsvwd82rEI+w+803+7fzAIcHzLXqoUxUv6lfblcxSksmMIZwH3hZ0LRpDZhn Wq6by2Oyi1Ekq9dSLBambt9GIilkQy8oHn5L7EFuU2AUiY4H+ZSSvZD5Wt83xsKhx2NyY kMa+1BlZCrZ+3XqhEMVvidUe9V7zhfrNfPr/SLlDO9BggOjsolEoJU4c2R/8JvUeSqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796063229; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=hS00FiHSugPUVeI3Ms83PEyqxLDttPmXA3TO3JIteM4=; b=hal4UnhRfO2W0LSbIFNdPJAH7jHvTpTzJIbILFGuQgbaR3stip198FpxBtHsZnu015Aw aiEzASQyNc0CJoPTzy3QYotdwl/XqNf57YBcr/sLDOh4GDaw+znjzC39dgA/ZoeEPeZy9 KO1bquXN9Y1cTsZx+WWJH6y5aRYFxE5ZkAfdxFawZ889ovWDIrmcFhvnws0yqhYK9/ddh kPpoHNbLFCIGfiR4jDYGn471mZl6S1kfvtGG4KJNHRQB6FuSuyi2JjCCFfckuntTypuvE 5FJ+ucqvBANdqSAtcOF8d9rNpB/MAChLxW7kFoa3aBC6LZx5v52lEzNEg6ibGZhWpHw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=openvz.org; spf=pass smtp.mailfrom=openvz.org; dkim=pass header.d=openvz.org header.i=@openvz.org header.a=rsa-sha256 header.s=google header.b=pvyq1d4d; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 620E7606A320 for ; Mon, 30 Nov 2026 18:27:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 620E7606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=openvz.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=openvz.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.a=rsa-sha256 header.s=google header.b=pvyq1d4d Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bb6adaf0f1so92623215e9.0 for ; Mon, 30 Nov 2026 10:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1796063227; x=1796668027; darn=lists.linux.dev; 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=hS00FiHSugPUVeI3Ms83PEyqxLDttPmXA3TO3JIteM4=; b=pvyq1d4doNHBW7f2RXMGxwMsKCBZL3XQ3T2cZdzhupq3PHLz9p3863thPh5Iy14kzL mrBsglDIQZp3UXJC/xxQjyCH82f3uUTpPa0KFW2vgOy+v5xuI+4flYZ2ncTpkmfvAY3b FeOvA1DeospZwEoYHfhY7j3jwrxYPPBHM4yrBv5z9ToDwZkX4kB6DUA+fWmBZ2uTWeh0 z4TkTT8OadkDZ+Js3RNrUrGoQh2HSiMTa0ockL1PdgfjSaVAmi5dXFIWNHDhHjByTzZR 2OM12E5qicnCshreEWxm+sWLRQJKnnzFg/Gl8PD3Gxv4AU2VN8KPbQh/wXyOtd6mowkt uGLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796063227; x=1796668027; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hS00FiHSugPUVeI3Ms83PEyqxLDttPmXA3TO3JIteM4=; b=UQdjxg0Hqesua+EqN+YyOy+kBfUYnEpMQnvYBR+5OEhMyMrfI9iQhAgRDc6tQ5BxaA W1MnZsgMXDznXCVFixMIh+G71rZPTBugEBIooX1GlPMP0yX3Ce5isZ7qLggsnLB0k1Np Ht8CI0vkeqvi2POlbhK9cmXp7jie74miOxJ6FLe2zt8SxDsQ5FUqH1anIMz6ksVyn+6o N1uRF4ioKU6ywtZuh98XNTHvIIJLNdy0RdEQCwRDS4DMTQBe/6+O3Xl4QW49uLXSTwsE F6cidHPXRFE2PkKUqRirXr6Mu8sob4HBKtK70CTCkRRxRDaqF/fqC0FumJeFplHW2lZH a3yA== X-Forwarded-Encrypted: i=1; AL+hErEKcDefALVK4aNCJkk/ncU4F8YWUPTvsKcnv43Ssa5QJo8E1w8c7HANYF1wvbf+1cz52Sn+8NbDTQ==@lists.linux.dev X-Gm-Message-State: APuU4Z/dlID5kVyzLPvoPRg0TMUJRRIwNmMblLAZz42BB8ZA9qB+4D8y 3x3Xk4o6G52MjkhCdAuXTsLZIL+t9wSGBpYCgiyLpjCNyq3Sd8MU4dTGiacg8j1x2ZA= X-Gm-Gg: AZFdTZeq9TaP3a7UijKVuyGlEIy7/I2wh2BUBuIFH/x1OpAjv0Tdp5gfOr6kH0fZ2q0 SkbO4R//YV5PJkZ5iLQqcj5+WrDprU3wpZmUb3DkxjX412JS/0J5pINlYnVhYjqggdeLxAumenv XgooIyyfAth8b2DpiiFCpdwPNX9yEebDs8NzxrA9VcGQzdFJ58eb9P1T+djh9KCWVbXAdR9Ew6V DutrEFHLG42fc+DTyYwTeUFDF/wrBeeA/N1LU9BMwinIastNO++T15OE8oYHkffZx+ZzGhAVhtd NVBfCAQhB19yx69/kVchyfY9+KysBjaZoAM+03roRV8nd2SLxW4AGMY63w60/SWHz0KVANpN81K 1IPaoExPTAqP25GkysmOFWUhz+yMl5QJaPtbLVJkqs32KnjyndJ0WcQPqoY5rQlEd48RGUEYXPZ TMJl3a02kqUDxv7e4sRbAhq7JgrWKXOjL+OmlY7fAs1xoC/BBuRvkZ3j7Ai9VDwW7Yj2eFq3rWJ VmOxkdqOIlEv5ak3zlK1gqwXpATX8Hb1uCYXHxunHLOjYoewehAB+JpesWsG0IOrxVWFQkwLgdl vq+bzV+2/8BRsZu5b4sX5K91wTw= X-Received: by 2002:a05:600c:1546:b0:4a1:fc98:1cb1 with SMTP id 5b1f17b1804b1-4bb887c2cb0mr748299565e9.2.1796063226667; Mon, 30 Nov 2026 10:27:06 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:5748:a9a4:9c41:84f3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab65cb41f4sm63908482f8f.7.2026.11.30.10.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 10:27:06 -0800 (PST) From: "Denis V. Lunev" To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, dm-devel@lists.linux.dev Cc: bmarzins@redhat.com, thornber@redhat.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, den@openvz.org Subject: [PATCH v3 0/3] dm era: a metadata device that never comes back Date: Mon, 30 Nov 2026 19:27:00 +0100 Message-ID: <20261130182704.2728591-1-den@openvz.org> X-Mailer: git-send-email 2.55.0 X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We move running containers between machines without restarting them, and their block volumes travel with them, so dm-era tells us which blocks changed between copy passes. About one move in three ended with the volume dead rather than moved: the metadata broke, every commit after it failed, the target reported "era Error", and the writes it tracked began to fail, which takes the workload's filesystem read-only. Rebuilding the device recovers the tracking, not the filesystem. Three unrelated causes, all of which the kernel log blames on the space map, which is the victim. Two need no bad luck: multipathd asks every target that appears for its status, so one is asked exactly while it resumes, and again while it suspends. The third is older and wider - a transient read failure in the persistent-data library leaves the space map short, and the next commit makes that permanent. dm-thin and dm-cache reach it too, where it costs a transaction rather than the device, because they can abort and dm-era cannot. Each patch is reproduced on a kernel whose only modification is the fix under test. Patch 3 must not be backported before patch 2, nor before cca2c6aebe86, where the resize goes through the worker the two would refuse. v2: https://lore.kernel.org/dm-devel/20261124122601.436965-1-den@openvz.org/ v1: https://lore.kernel.org/dm-devel/20261118110239.2910290-1-den@openvz.org/ Changes since v2: - patch 1 releases the block allocated for the copy on the paths that fail, which v2 left leaked. v2 argued that releasing it is wrong while the space map is in bootstrap mode, where blocks are handed out without a count to decrement. That was wrong: sm_ll_extend() calls dm_tm_new_block() in exactly that mode, and its error path already decrements the block it allocated, so the two neighbours differed for no reason. Reported by the Sashiko AI review. - the unwind label that takes the original's reference back is named for what it does rather than for releasing one. Changes since v1: - patch 1 no longer moves the decrement past the copy. Holding the copy's write lock across dm_sm_dec_block() raises the number of blocks one task holds, because the decrement starts by shadowing a bitmap block of its own, and the targets size their dm-bufio reserve for the peak without that. Denis V. Lunev (3): dm persistent data: put back the reference a failed shadow dropped dm era: refuse metadata rpcs once the target is suspended dm era: construct the target suspended drivers/md/dm-era-target.c | 10 +++++++++- drivers/md/persistent-data/dm-transaction-manager.c | 13 ++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) -- 2.55.0