]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: btrfs: add a regression test for incorrect inode incompressible flag
authorQu Wenruo <wqu@suse.com>
Mon, 9 Feb 2026 09:57:35 +0000 (20:27 +1030)
committerZorro Lang <zlang@kernel.org>
Mon, 16 Feb 2026 13:17:52 +0000 (21:17 +0800)
commiteeb894a242c8d200b7ed4c8b7da3d54e24e02c6f
tree2bba06d8a4727325e4ddfc07efbafd4f9318d5cd
parent66c8f2df3f3a8803c05336fff4c3ae3048b468b1
fstests: btrfs: add a regression test for incorrect inode incompressible flag

[BUG]
Since kernel commit 59615e2c1f63 ("btrfs: reject single block sized
compression early"), a single block write at file offset 0, which can
not be inlined due the inode size, will mark the inode incompressible.

[REGRESSION TEST]
The new regression test will do:

- Create and mount the fs with compression,max_inline=2k

- Do the following operations:
  * Truncate the inode to 2 * blocksize
    This will rule out any future inlined writes.

  * Buffered write [0, 2K)
    Which will not be inlined.

  * Sync
    For affected kernels, this will set the inode with NOCOMPRESS
    and reject all future compression on that inode.

  * Buffered write [1M, 2M)
    For affected kernels, the range will not be compressed due
    to the NOCOMPRESS flag.

- Unmount the fs

- Make sure that:
  * The inode has no NOCOMPRESS flag
  * File extent at file offset 1M is being compressed

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/343 [new file with mode: 0755]
tests/btrfs/343.out [new file with mode: 0644]