Skip to content

Fix for btrfs/156 failure and misc enhancements relocated to relocation

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 4 repliesIn review

Changes in v2 from the cover letter

- Add supporting miscellaneous patches
- Commit message change for the main fix
* Directly explain how the ENOSPC is caused
* Add comment for what will happen if we really run out of space

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: volumes: Unexport find_free_dev_extent_start()fs/btrfs/volumes.c fs/btrfs/volumes.h+3 -41 reply
2/4btrfs: volumes: Add comment for find_free_dev_extent_start()fs/btrfs/volumes.c+6 -01 reply
3/4btrfs: extent-tree: Add comment for inc_block_group_ro()fs/btrfs/extent-tree.c+19 -01 reply
4/4btrfs: volumes: Remove ENOSPC-prone btrfs_can_relocate()fs/btrfs/ctree.h fs/btrfs/extent-tree.c fs/btrfs/volumes.c+0 -1461 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJohannes Thumshirn
1/4R-b
2/4R-b
3/4R-b
4/4

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/4] Fix for btrfs/156 failure and misc enhancements relocated to relocation

Btrfs/156 fails after commit 302167c50b32 ("btrfs: don't end the transaction for delayed refs in throttle"), however it's not that commit's fault.

The root cause is btrfs_can_relocate() can report false ENOSPC when there is any block group freed in current transaction.

However thanks to all the hard work due to btrfs balance, we don't really need some early ENOSPC check, as the current ENOSPC report at extent reservation time is good enough for balance.

So the main fix is just to remove btrfs_can_relocate(), in patch 4.

Patch 1~3 are miscellaneous patches. Patch 1 unexport find_free_dev_extent_start(), Patch 2 and 3 adds comment for possible confusing behaviors, like find_free_dev_extent_start() only searches commit root, and inc_block_group_ro() only cares if we have 1M free space left, not caring if other block groups can contain the used space.

Any of the miscellaneous patches can be dropped if needed.

Changelog:
v2:
- Add supporting miscellaneous patches
- Commit message change for the main fix
* Directly explain how the ENOSPC is caused
* Add comment for what will happen if we really run out of space

Qu Wenruo (4):
btrfs: volumes: Unexport find_free_dev_extent_start()
btrfs: volumes: Add comment for find_free_dev_extent_start()
btrfs: extent-tree: Add comment for inc_block_group_ro()
btrfs: volumes: Remove ENOSPC-prone btrfs_can_relocate()

 fs/btrfs/ctree.h       |   1 -
 fs/btrfs/extent-tree.c | 160 +++++------------------------------------
 fs/btrfs/volumes.c     |  15 ++--
 fs/btrfs/volumes.h     |   2 -
 4 files changed, 28 insertions(+), 150 deletions(-)
Signature · 1 line
2.22.0