Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v4 0/4] btrfs: zoned: fix active-zone accounting and transitions
@ 2026-11-25 10:21 Dongjiang Zhu
  2026-11-25 10:21 ` [PATCH v4 1/4] btrfs: zoned: track only sequential zones as active Dongjiang Zhu
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Dongjiang Zhu @ 2026-11-25 10:21 UTC (permalink / raw)
  To: linux-btrfs; +Cc: johannes.thumshirn, naohiro.aota, a2jphilipp

This series addresses active-zone accounting and block group
transitions on zoned devices. It simplifies conventional-zone handling,
restores metadata/system write roles at mount, and addresses a
balance self-deadlock and a race during zone finishing.

The four patches:

1. Track only sequential zones as active.
2. Restore the normal metadata and system write roles at mount,
   keeping one active block group for each role and finishing the
   remaining active non-data block groups.
3. Remove obsolete allocation-time non-data activation, leaving
   activation and role switching to the writeback path.
4. Serialize concurrent finish operations on the same block group,
   keeping it active until the device operations and active-list
   cleanup complete.

Jochen Philipp tested a rebased version of this series on his
filesystem. He reported writing another 2.3 TB via rsync without
Btrfs errors, a clean unmount, no errors from btrfs check --readonly,
and a successful read-write mount afterwards. Many thanks to Jochen
for the extensive testing.

Changes in v4:
- Rebased onto btrfs for-next at 7bfc2c517eac.
- Retained the upstream active-zone bitmap check for mount-time
  reservation accounting and the conditional reservation updates
  during activation and finishing.
- Moved abandoned-tail accounting into do_zone_finish(), alongside
  the alloc_offset update, preserving read-only block group accounting.
- Removed the unnecessary temporary block group references in
  mount-time cleanup.
- Updated the commit messages to reflect the current base and clarify
  the role-recovery and zone-finishing behavior.

Changes in v3:
- Dropped the block-group flag comment changes from patch 1; no
  functional changes.

Changes in v2:
- Removed the [BUG], [CAUSE] and [FIX] headings from the commit messages.
- Added a helper for identifying zones that need active-zone tracking.
- Added block group locking around alloc_offset and zone_unusable
  accesses during mount recovery.
- Explained why moving the active-bit clear alone does not serialize
  concurrent zone finish operations.

Previous versions:
v3: https://lore.kernel.org/linux-btrfs/cover.1787887776.git.zhudongjiang@fygo.io/
v2: https://lore.kernel.org/linux-btrfs/cover.1787717573.git.zhudongjiang@fygo.io/
v1: https://lore.kernel.org/linux-btrfs/cover.1787551793.git.zhudongjiang@fygo.io/

Dongjiang Zhu (4):
  btrfs: zoned: track only sequential zones as active
  btrfs: zoned: recover active non-data block group roles on mount
  btrfs: zoned: remove obsolete non-data block group activation helper
  btrfs: zoned: serialize zone finishing per block group

 fs/btrfs/block-group.c |  38 ++------
 fs/btrfs/block-group.h |   1 +
 fs/btrfs/disk-io.c     |   7 +-
 fs/btrfs/zoned.c       | 211 +++++++++++++++++++++++++++++------------
 fs/btrfs/zoned.h       |   9 +-
 5 files changed, 167 insertions(+), 99 deletions(-)

-- 
2.39.5

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-12-03 10:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 10:21 [PATCH v4 0/4] btrfs: zoned: fix active-zone accounting and transitions Dongjiang Zhu
2026-11-25 10:21 ` [PATCH v4 1/4] btrfs: zoned: track only sequential zones as active Dongjiang Zhu
2026-11-25 10:21 ` [PATCH v4 2/4] btrfs: zoned: recover active non-data block group roles on mount Dongjiang Zhu
2026-12-02  9:08   ` Johannes Thumshirn
2026-12-02  9:25   ` Johannes Thumshirn
2026-12-02 10:16     ` Dongjiang Zhu
2026-12-02 11:25       ` Johannes Thumshirn
2026-12-03 10:21         ` Dongjiang Zhu
2026-11-25 10:21 ` [PATCH v4 3/4] btrfs: zoned: remove obsolete non-data block group activation helper Dongjiang Zhu
2026-11-25 10:21 ` [PATCH v4 4/4] btrfs: zoned: serialize zone finishing per block group Dongjiang Zhu
2026-12-02 11:26   ` Johannes Thumshirn
2026-12-02 11:46     ` Dongjiang Zhu
2026-12-02 15:03       ` Johannes Thumshirn
2026-11-27 13:34 ` [PATCH v4 0/4] btrfs: zoned: fix active-zone accounting and transitions Jochen Philipp
2026-11-30  7:09   ` Dongjiang Zhu
2026-11-30 15:00     ` Jochen Philipp
2026-12-02 10:11       ` Dongjiang Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox