Skip to contentSkip to conversation

btrfs: add NOCOMPRESS defrag regression coverage

PATCH New Dhruva G 1 participant 1 message Oct 11 Btrfs file system

lore
Share & tools
lore

Dhruva G

author
#0 lore raw

cover btrfs: add NOCOMPRESS defrag regression coverage

Add regression coverage for BTRFS_DEFRAG_RANGE_NOCOMPRESS, introduced by kernel commit 009b2056cb25 ("btrfs: defrag: add flag to force no-compression").

The series checks bounded conversion and EOF handling, preservation of holes and preallocated extents, and inline extent eligibility and short EOF tails. FIEMAP assertions inspect every overlapping extent and require complete range coverage. File contents, sizes, and extent state are checked again after remounting.

Patch 1 adds the shared helpers and a small raw-ioctl program used for feature probing and errno checks. Patches 2 and 3 add sparse-layout and inline/tail coverage. The tests require 4K sectors and btrfs-progs with --nocomp support; unsupported configurations skip.

Tested on an x86_64 QEMU/KVM guest with:

Linux 7.3.0-rc3-next-20260918-btrfs-lab
btrfs-progs v7.1
4K Btrfs scratch sectors

Dhruva Gole (3):
btrfs: exercise NOCOMPRESS range and EOF handling
btrfs: check NOCOMPRESS preserves holes and preallocation
btrfs: cover NOCOMPRESS inline eligibility and short tails

 .gitignore                |   1 +
 common/btrfs_nocomp       | 134 ++++++++++++++++++++++++++++++++++++++
 src/Makefile              |   2 +-
 src/btrfs_defrag_nocomp.c |  63 ++++++++++++++++++
 tests/btrfs/355           |  80 +++++++++++++++++++++++
 tests/btrfs/355.out       |   2 +
 tests/btrfs/356           |  71 ++++++++++++++++++++
 tests/btrfs/356.out       |   2 +
 tests/btrfs/357           |  59 +++++++++++++++++
 tests/btrfs/357.out       |   2 +
 10 files changed, 415 insertions(+), 1 deletion(-)
 create mode 100644 common/btrfs_nocomp
 create mode 100644 src/btrfs_defrag_nocomp.c
 create mode 100755 tests/btrfs/355
 create mode 100644 tests/btrfs/355.out
 create mode 100755 tests/btrfs/356
 create mode 100644 tests/btrfs/356.out
 create mode 100755 tests/btrfs/357
 create mode 100644 tests/btrfs/357.out

base-commit: 56c410ad0f69da5b13c5807bc47b4876dcfa02b2

Signature · 1 line
2.43.0