Skip to content

btrfs: zoned: fixes for zone finishing

Naohiro Aota linux-btrfs stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 3 repliesIn review
  2. v14 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5btrfs: zoned: introduce btrfs_zoned_bg_is_fullfs/btrfs/extent-tree.c fs/btrfs/zoned.c fs/btrfs/zoned.h+8 -30 replies
2/5btrfs: zoned: consolidate zone finish functionfs/btrfs/zoned.c+64 -731 reply
3/5btrfs: zoned: finish BG when there are no more allocatable bytes leftfs/btrfs/zoned.c+10 -10 replies
4/5btrfs: zoned: properly finish block group on metadata writefs/btrfs/block-group.h fs/btrfs/extent_io.c fs/btrfs/extent_io.h +2 more+42 -60 replies
5/5btrfs: zoned: zone finish unused block groupfs/btrfs/block-group.c+8 -00 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPankaj RaghavJohannes Thumshirn
SeriesR-b
1/5
2/5
3/5R-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] btrfs: zoned: fixes for zone finishing

- Changes
- v2
- Rename some functions/variables.
- Intoduce btrfs_zoned_bg_is_full() to check if a block group is fully allocated or not.
- Add some more comments.

* Note: this series depends on "btrfs: zoned: fix zone activation logic" series (patch 1). I found the bug addressed in the series while I'm introducing the helper.

Commit be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") introduced zone finishing a block group when the IO reaches at the end of the block group. However, since the zone capacity may not aligned to 16KB (node size), we can leave an un-allocatable space at the end of a block group. Also, it turned out that metadata zone finishing never works actually.

This series addresses these issues by rewriting metadata zone finishing code to use a workqueue to process the finishing work.

Patch 1 introduces a helper to check if a block group is fully allocated. The helper is used in patch 2.

Patch 2 is a clean-up patch to consolidate zone finishing function for better maintainability.

Patch 3 changes the left region calculation so that it finishes a block group when there is no more space left for allocation.

Patch 4 fixes metadata block group finishing which is not actually working.

Patch 5 implements zone finishing of an unused block group and fixes active block group accounting. This patch is a bit unrelated to other ones. But, the patch is tested with the previous patches applied, so let me go with the same series.

Naohiro Aota (5):
btrfs: zoned: introduce btrfs_zoned_bg_is_full
btrfs: zoned: consolidate zone finish function
btrfs: zoned: finish BG when there are no more allocatable bytes left
btrfs: zoned: properly finish block group on metadata write
btrfs: zoned: zone finish unused block group

 fs/btrfs/block-group.c |   8 ++
 fs/btrfs/block-group.h |   2 +
 fs/btrfs/extent-tree.c |   3 +-
 fs/btrfs/extent_io.c   |   6 +-
 fs/btrfs/extent_io.h   |   1 -
 fs/btrfs/zoned.c       | 176 ++++++++++++++++++++++++-----------------
 fs/btrfs/zoned.h       |  11 +++
 7 files changed, 128 insertions(+), 79 deletions(-)
Signature · 1 line
2.35.1