All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs-progs: tune: bgt resume related fix and enhancement
Date: Wed, 18 Jun 2025 14:53:38 +0930	[thread overview]
Message-ID: <cover.1750223785.git.wqu@suse.com> (raw)

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/a90b9418-48e8-47bf-8ec0-dd377a7c1f4e@gmail.com/

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


             reply	other threads:[~2025-06-18  5:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  5:23 Qu Wenruo [this message]
2025-06-18  5:23 ` [PATCH 1/3] btrfs-progs: tune: fix uninitialized value which leads to failed resume Qu Wenruo
2025-06-18  5:23 ` [PATCH 2/3] btrfs-progs: optimize the block group item load for half converted fs Qu Wenruo
2025-06-18  5:23 ` [PATCH 3/3] btrfs-progs: misc-tests: add an image for btrfstune bgt conversion Qu Wenruo
2025-06-20 17:08   ` David Sterba
2025-06-20 23:29     ` Qu Wenruo
2025-06-20 17:10 ` [PATCH 0/3] btrfs-progs: tune: bgt resume related fix and enhancement David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1750223785.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.