public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] btrfs-progs: mkfs/rootdir: cleanup and test case enhancement
@ 2026-04-09  4:31 Qu Wenruo
  2026-04-09  4:31 ` [PATCH v3 1/5] btrfs-progs: mkfs-tests: also test hole-deteciton without no-holes Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Qu Wenruo @ 2026-04-09  4:31 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v3:
- Remove the fiemap based prealloc detection
  The complexity doesn't really bring any other benefit and preallocated
  space itself is not that commonly used for fs image creation.

- Update the image size estimation
  To fully co-operate with the new hole detection.

v2:
- Add a new test case to verify hole detection with/without no-holes
  There is a bug in the ^no-holes handling that an incorrect file extent
  is inserted with uninitialized type.

  Exposed and fixed by Mark.

- Add a new test case to verify the file contents of hole detection

  There is a bug in the refactor of read, which overwrites the buffer
  instead of properly advance the cursor.

  Exposed by Mark with Chris Mason's review prompts.

- Keep the existing first block based bad compress ratio detection
  Previously if we had bad compression ratio after the first block, we
  do not mark the inode incompressible.

  Follow the existing behavior.

- Fix the hole size capping in fiemap mode
  Which previously is not capping the hole size, and can trigger
  UASSERT()s.

- Enhance the new fiemap test case with fssum
  To verify both the hole and file contents matches.

The PR can be found here:

  https://github.com/kdave/btrfs-progs/pull/1103

The first 2 patches are enhancing mkfs test cases to be more robust,
covering both no-holes and ^no-holes features, as Mark exposed a bug
affecting ^no-holes only in previous hole-detection.

The 3rd patch extracts btrfs_insert_hole_extent() to make it a little
simpler to use, without the need to populate a local on-stack file
extent item.

The 4th patch makes compressed write path easier to read, without
combining both compressed and uncompressed paths.

The final one is to use st_blocks to estimate the data size, so the
resulted fs image can be as small as possible.


Qu Wenruo (5):
  btrfs-progs: mkfs-tests: also test hole-deteciton without no-holes
  btrfs-progs: mkfs-tests: add a test case to verify the content of
    rootdir
  btrfs-progs: implement the missing btrfs_insert_hole_extent()
  btrfs-progs: mkfs/rootdir: extract compressed write path
  btrfs-progs: mkfs/rootdir: use st_blocks for size estimation

 Makefile                                      |   2 +-
 kernel-shared/file-item.c                     |  17 ++
 kernel-shared/file.c                          |   6 +-
 mkfs/rootdir.c                                | 272 ++++++++++--------
 tests/mkfs-tests/041-hole-detection/test.sh   |  48 ++--
 tests/mkfs-tests/042-rootdir-contents/test.sh |  57 ++++
 6 files changed, 260 insertions(+), 142 deletions(-)
 create mode 100755 tests/mkfs-tests/042-rootdir-contents/test.sh

--
2.53.0


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

end of thread, other threads:[~2026-04-09  4:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09  4:31 [PATCH v3 0/5] btrfs-progs: mkfs/rootdir: cleanup and test case enhancement Qu Wenruo
2026-04-09  4:31 ` [PATCH v3 1/5] btrfs-progs: mkfs-tests: also test hole-deteciton without no-holes Qu Wenruo
2026-04-09  4:31 ` [PATCH v3 2/5] btrfs-progs: mkfs-tests: add a test case to verify the content of rootdir Qu Wenruo
2026-04-09  4:31 ` [PATCH v3 3/5] btrfs-progs: implement the missing btrfs_insert_hole_extent() Qu Wenruo
2026-04-09  4:31 ` [PATCH v3 4/5] btrfs-progs: mkfs/rootdir: extract compressed write path Qu Wenruo
2026-04-09  4:31 ` [PATCH v3 5/5] btrfs-progs: mkfs/rootdir: use st_blocks for size estimation Qu Wenruo

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