From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/2] btrfs-progs: mkfs/rootdir: add hole detection
Date: Mon, 23 Mar 2026 16:21:35 +1030 [thread overview]
Message-ID: <cover.1774244873.git.wqu@suse.com> (raw)
This patchset is already submitted as a github PR, this is mostly for
tracking purposes:
https://github.com/kdave/btrfs-progs/pull/1097
Currently mkfs.btrfs --rootdir will always read out the content from
rootdir, and write them into the target fs.
This is IO consuming as we need to read out the data from host fs, and
write them into the target btrfs, and also CPU consuming as we need to
generate the data checksum.
With hole detection we can not only skip the IO and csum generation, but
also result less space usage for the target fs.
The first patch is implementing the new hole detection, and the second
one is the test case for it.
There is a small note for the test case. As I mentioned the 2GiB hole
size problem in the first place, I should put the test case to include a
huge hole (>=2GiB), but unfortunately that will greatly slow down the
test case since md5sum doesn't have any shortcut to handle large holes.
Considering the CI machine time increase, I intentionally limited the
hole size in the test case.
If one day we're not limited by the free machine time from github CI or
have a local CI worker, I'm definitely fine to add a new large hole into
the test case.
Qu Wenruo (2):
btrfs-progs: mkfs/rootdir: add hole detection
btrfs-progs: mkfs-tests: add a test case for mkfs hole detection
mkfs/rootdir.c | 36 ++++++++++-
tests/mkfs-tests/041-hole-detection/test.sh | 70 +++++++++++++++++++++
2 files changed, 103 insertions(+), 3 deletions(-)
create mode 100755 tests/mkfs-tests/041-hole-detection/test.sh
--
2.53.0
next reply other threads:[~2026-03-23 5:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 5:51 Qu Wenruo [this message]
2026-03-23 5:51 ` [PATCH 1/2] btrfs-progs: mkfs/rootdir: add hole detection Qu Wenruo
2026-03-23 5:51 ` [PATCH 2/2] btrfs-progs: mkfs-tests: add a test case for mkfs " Qu Wenruo
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.1774244873.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox