linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Fix for btrfs/156 failure and misc enhancements relocated to relocation
@ 2019-07-19  6:51 Qu Wenruo
  2019-07-19  6:51 ` [PATCH v2 1/4] btrfs: volumes: Unexport find_free_dev_extent_start() Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Qu Wenruo @ 2019-07-19  6:51 UTC (permalink / raw)
  To: linux-btrfs

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(-)

-- 
2.22.0


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

end of thread, other threads:[~2019-07-31 15:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-19  6:51 [PATCH v2 0/4] Fix for btrfs/156 failure and misc enhancements relocated to relocation Qu Wenruo
2019-07-19  6:51 ` [PATCH v2 1/4] btrfs: volumes: Unexport find_free_dev_extent_start() Qu Wenruo
2019-07-19  9:21   ` Johannes Thumshirn
2019-07-19  6:51 ` [PATCH v2 2/4] btrfs: volumes: Add comment for find_free_dev_extent_start() Qu Wenruo
2019-07-19  9:47   ` Johannes Thumshirn
2019-07-19  6:51 ` [PATCH v2 3/4] btrfs: extent-tree: Add comment for inc_block_group_ro() Qu Wenruo
2019-07-19  9:41   ` Johannes Thumshirn
2019-07-19  6:51 ` [PATCH v2 4/4] btrfs: volumes: Remove ENOSPC-prone btrfs_can_relocate() Qu Wenruo
2019-07-31 15:26   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).