public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs-progs: mkfs/rootdir: add hole detection
@ 2026-03-23  5:51 Qu Wenruo
  2026-03-23  5:51 ` [PATCH 1/2] " Qu Wenruo
  2026-03-23  5:51 ` [PATCH 2/2] btrfs-progs: mkfs-tests: add a test case for mkfs " Qu Wenruo
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-03-23  5:51 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2026-03-23  5:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23  5:51 [PATCH 0/2] btrfs-progs: mkfs/rootdir: add hole detection Qu Wenruo
2026-03-23  5:51 ` [PATCH 1/2] " Qu Wenruo
2026-03-23  5:51 ` [PATCH 2/2] btrfs-progs: mkfs-tests: add a test case for mkfs " Qu Wenruo

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