btrfs: zoned: fix removing of unwritten non-data block group
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 2 repliesIn review
- v12 patches 2 repliesSuperseded
Changes from the cover letter
- v2
- Refine has_unwritten_metadata() structure.
- Add message when hitting the WARN_ON.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: zoned: do not remove unwritten non-data block groupfs/ | +25 | 1 reply | |
| 2/2 | btrfs: zoned: requeue to unused block group list if zone finish failedfs/ | +3 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Johannes Thumshirn |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] btrfs: zoned: fix removing of unwritten non-data block group
There are some reports of "unable to find chunk map for logical 2147483648 length 16384" error message appears in the dmesg. This means some IOs are occurring after a block group is removed.
The IOs are coming from unused dirty tree nodes. When a metadata tree node is cleaned on the zoned setup, we keep that node still dirty and write it out not to create a write hole. When user operation e.g, fsync() is fast enough, we can have a block group full of "unused dirty" tree nodes. Such block group has its used count == 0, making it "unused" block group and candidate for removal.
Removing the block group keeps the dirty nodes unsent until next sync or umount operation. At that time, such nodes will cause the "unable to find chunk map" failures.
This sympton can happen relatively easy on SMR, whose zone size == 256MB, but it is hidden coincidently hitting a check in do_zone_finish(). Hitting the check remove the block group from the unused list and let it never reclaimed, which itself is a problem.
Fix them adding an extra check in the BG removal process and put a block group in the retry list when btrfs_zone_finish() returns -EAGAIN.
Changes:
- v2
- Refine has_unwritten_metadata() structure.
- Add message when hitting the WARN_ON.
Naohiro Aota (2):
btrfs: zoned: do not remove unwritten non-data block group
btrfs: zoned: requeue to unused block group list if zone finish failed
fs/btrfs/block-group.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-)
Signature · 1 line
2.50.0