From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=79.135.106.113 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795268761; b=sbsBXwHe+2H24jQkUuEUNKE6XJ9LnCNkWv3KnK18kndgZadLxa+g5tD1xQ0FUuLtKn6a yPIggSPlP8NbyGQHgRgLaZfnNdV1GrZJBd8f8wUjQrrNzT4rpkL09N1NOvjRzDGlpXhLZ L99lOCjOX3/bVB1JGqNJzC5lvkuifRf/KWVEgMrZs7K8q9KKscT0108a1htlbrQEcVa4a E1pikrKO1ilhHNbQpSZH3w85MlimLLpxiENMcfCGtEhFBKq/IfCQLflbSsNnt8hgdktZ3 zwvSHh+bX9p/LLtMOPMegWCejf843B8/o7oZHKwIPj344lTbBSF/yNvlmeOaCA2J3ag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795268761; h=DMARC-Filter:DKIM-Signature:X-Pm-Submission-Id:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=LmyZFdxowZH155razIxR4qvAydcS9K3H+kHlAZaGnBk=; b=b+J1NAOuh2g3BY+6NEUdaFcFpMJfmKOtT67BXRqiFFObrrE/GWpZcHxUjKh9v8qO9T0H 7CAFtUjGYdTQy+3KfzZaR4DjQCC27rnnHk5Jh23MuI/09wxnrkh6TWm76LQ0V//dn6r+z IwcjuUkh7UukQvi1CkTXWJwIWAgSoDt4eNnAilmKZCBMvqpUatwxd8TIwNO5pdcKBlIDz pCfo/TiLwDDZf3Uv8m9SEul732GJ891qsi/R1kT791oQA0rlWfCXS1ByNgZu7n7EnPRV7 mI2U94f6jYj8Bkph5sb8wplgTb6OtpJGkGaRV9SrbEJfWli2LIa732ucM5wT9/USx1g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=raidlab.org; spf=pass smtp.mailfrom=raidlab.org; dkim=pass header.d=raidlab.org header.i=@raidlab.org header.a=rsa-sha256 header.s=protonmail header.b=NXnmCHLA; arc=none smtp.remote-ip=79.135.106.113 Received: from mail-106113.protonmail.ch (mail-106113.protonmail.ch [79.135.106.113]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5836C606A32A for ; Sat, 21 Nov 2026 13:46:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5836C606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raidlab.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raidlab.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=raidlab.org header.i=@raidlab.org header.a=rsa-sha256 header.s=protonmail header.b=NXnmCHLA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raidlab.org; s=protonmail; t=1795268757; x=1795527957; bh=LmyZFdxowZH155razIxR4qvAydcS9K3H+kHlAZaGnBk=; h=From:To:Cc:Subject:Date:Message-ID:From:To:Cc:Date:Subject: Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=NXnmCHLA87MR9Iqk9seTfK3O9YEj7PSWzOpZxT+uUCTgkChb3vjphhQScpYjplw3h mB+2P+Rxk8mDSGPtM/OQj/L45g1AhX/AT9IEI1pyXr254tF0YEUAW5EwvpWhi/Hyo3 EPlLUaybiY+YZ6XJh7+GjKbXVhHAajefnlQZAOkR8bmJsOMhDGxbvjutk/t3b2TQ6f z9J7GWM/NhmohnCtb2jOoS3LLAjjpy24FWNFxuSh3sLgM3ZXLTMlhLQ+TdU3Fksb73 IhBOm9zVh95/xugb1annwrRbFMMeeAGyw4tUuUqW35tdaS8u6TM00/fDAkZAO4szKz kcaEmD+N+xwvg== X-Pm-Submission-Id: 4jWtl80f73z1DDny From: Miroslav Cimerman To: linux-btrfs@vger.kernel.org Cc: David Sterba , Chris Mason , Naohiro Aota , Johannes Thumshirn , Qu Wenruo , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] btrfs: zoned: RAID1 block groups with missing or stale stripes Date: Sat, 21 Nov 2026 13:45:44 +0000 Message-ID: <20261121134550.216217-1-mc@raidlab.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit btrfs_load_block_group_raid1() compares the active state and the write pointer of each present stripe with stripe 0's, and takes the zone capacity from stripes 0 and 1. But stripe 0 can be missing, any stripe can be behind the others on a degraded mount, and the full zones of a block group can report different capacities. - 1/5 compares the active state with the first present stripe. With stripe 0 missing, such block groups were left off the active list, and writes to them could hang. - 2/5 takes the zone capacity from all present stripes. RAID1C3 and RAID1C4 block groups failed to load with stripes 0 and 1 missing, once they held data, and were written past a smaller third or fourth stripe. - 3/5 takes a full zone with more capacity than the block group as written up to the block group's capacity, unless an extent ends past it. Before, a regular mount failed on such block groups. - 4/5 allocates from the highest write pointer on degraded mounts. Stripe 0's can be behind, and new extents then went over committed ones. It also lets a regular mount load a block group whose stripe 0 is on an offline or read-only zone. - 5/5 adds self-test cases. v2: - 2/5: was 3/4, moved before 3/5, which needs the block group's capacity. It takes the capacity from all present stripes now - 3/5: new. v1 failed a degraded mount with all devices present and full zones of different capacities, which loaded before when stripe 0 had the smallest one (found in an LLM review). Zones with an extent past the capacity are not capped - 4/5 (was 2/4): mark a metadata block group with a mismatch active if any of its zones is. With an empty first zone, it stayed inactive and warned at its next write (reported by Sashiko) - 5/5: add cases with an empty first zone, with different zone capacities and with a failed zone report, and a capacity per stripe. Renamed, as 6 of the 14 new cases are on a regular mount - rebased on for-next 184fa2c40f5c v1: https://lore.kernel.org/linux-btrfs/20261119213835.103131-1-mc@raidlab.org/ Miroslav Cimerman (5): btrfs: zoned: take the RAID1 active state from the first present stripe btrfs: zoned: take the RAID1 zone capacity from all present stripes btrfs: zoned: cap full RAID1 zones at the block group's capacity btrfs: zoned: use the highest RAID1 write pointer on degraded mounts btrfs: tests: zoned: add RAID1 cases with missing or stale stripes fs/btrfs/tests/zoned-tests.c | 203 ++++++++++++++++++++++++++++++++++- fs/btrfs/zoned.c | 102 +++++++++++++++--- 2 files changed, 291 insertions(+), 14 deletions(-) base-commit: 184fa2c40f5c50afb1d8bf900eafadf450db392e -- 2.53.0