Skip to content

btrfs-progs: tune: bgt resume related fix and enhancement

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs-progs: tune: fix uninitialized value which leads to failed resumekernel-shared/extent-tree.c+1 -10 replies
2/3btrfs-progs: optimize the block group item load for half converted fskernel-shared/extent-tree.c+9 -360 replies
3/3btrfs-progs: misc-tests: add an image for btrfstune bgt conversiontests/common tests/misc-tests/069-btrfstune-resume-bgt/half-converted-bgt.raw.zst tests/misc-tests/069-btrfstune-resume-bgt/test.sh+23 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs-progs: tune: bgt resume related fix and enhancement

There is a bug report from the mailing list (1) that btrfstune failed to resume an interrupted conversion.

Although I hacked a small patch to skip the part of code that I believe is the cause, it doesn't properly explain why the bug happened, as the code looks good to me.

But with some time to tinker, I finally created a half-converted image and can reproduce the bug somewhat reliably.

It turns out to be an uninitialized structure, and this also exposed an inefficient behavior when reading block groups from the old extent tree.

Fix the bug first with the first patch.
Then enhance the extent tree block group items loading from the old tree.

Finally a new test image for the bug.

(1): https://lore.kernel.org/linux-btrfs/[email protected]/

Qu Wenruo (3):
btrfs-progs: tune: fix uninitialized value which leads to failed
resume
btrfs-progs: optimize the block group item load for half converted fs
btrfs-progs: misc-tests: add an image for btrfstune bgt conversion

 kernel-shared/extent-tree.c                   |  47 ++++--------------
 tests/common                                  |   8 +++
 .../half-converted-bgt.raw.zst                | Bin 0 -> 2760068 bytes
 .../069-btrfstune-resume-bgt/test.sh          |  15 ++++++
 4 files changed, 33 insertions(+), 37 deletions(-)
 create mode 100644 tests/misc-tests/069-btrfstune-resume-bgt/half-converted-bgt.raw.zst
 create mode 100755 tests/misc-tests/069-btrfstune-resume-bgt/test.sh

--
2.49.0