public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: mkfs: make sure we can clean up all temporary chunks
@ 2021-10-11  9:42 Qu Wenruo
  2021-10-11  9:42 ` [PATCH 1/3] btrfs-progs: rename @data parameter to @profile in extent allocation path Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Qu Wenruo @ 2021-10-11  9:42 UTC (permalink / raw)
  To: linux-btrfs

There is a bug report that with certain mkfs options, mkfs.btrfs may
fail to cleanup some temporary chunks, leading to "btrfs filesystem df"
warning about multiple profiles:

  WARNING: Multiple block group profiles detected, see 'man btrfs(5)'.
  WARNING:   Metadata: single, raid1 

The easiest way to reproduce is "mkfs.btrfs -f -R free-space-tree -m dup
-d dup".

It turns out that, the old _recow_root() can not handle tree levels > 0,
while with newer free space tree creation timing, the free space tree
can reach level 1 or higher.

To fix the problem, Patch 2 will do the proper full tree re-CoW, with
extra transaction commitment to make sure all free space tree get
re-CoWed.

The 3rd patch will do the extra verification during mkfs-tests.

The first patch is just to fix a confusing parameter which also caused
u64 -> int width reduction and can be problematic in the future.

Qu Wenruo (3):
  btrfs-progs: rename @data parameter to @profile in extent allocation
    path
  btrfs-progs: mkfs: recow all tree blocks properly
  btrfs-progs: mfks-tests: make sure mkfs.btrfs cleans up temporary
    chunks

 kernel-shared/extent-tree.c                 | 26 +++---
 mkfs/main.c                                 | 87 ++++++++++++++++++---
 tests/mkfs-tests/001-basic-profiles/test.sh | 10 ++-
 3 files changed, 97 insertions(+), 26 deletions(-)

-- 
2.33.0


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

end of thread, other threads:[~2021-10-11 11:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-11  9:42 [PATCH 0/3] btrfs-progs: mkfs: make sure we can clean up all temporary chunks Qu Wenruo
2021-10-11  9:42 ` [PATCH 1/3] btrfs-progs: rename @data parameter to @profile in extent allocation path Qu Wenruo
2021-10-11  9:42 ` [PATCH 2/3] btrfs-progs: mkfs: recow all tree blocks properly Qu Wenruo
2021-10-11  9:43 ` [PATCH 3/3] btrfs-progs: mfks-tests: make sure mkfs.btrfs cleans up temporary chunks Qu Wenruo
2021-10-11 10:29   ` David Sterba
2021-10-11 10:40   ` David Sterba
2021-10-11 11:12     ` Qu Wenruo
2021-10-11 10:31 ` [PATCH 0/3] btrfs-progs: mkfs: make sure we can clean up all " David Sterba

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