Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: remove the tailing zeros from compressed inline extents
@ 2026-09-19 11:18 Qu Wenruo
  2026-09-19 11:18 ` [PATCH 1/2] btrfs: fix the incorrect lzo space saving checks Qu Wenruo
  2026-09-19 11:18 ` [PATCH 2/2] btrfs: remove the trailing zeros from compressed inline extent Qu Wenruo
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-09-19 11:18 UTC (permalink / raw)
  To: linux-btrfs

Commit 3eaf5f082c4c ("btrfs: extract inlined creation into a dedicated
delalloc helper") changed the compression input from [0, i_size) to [0,
blocksize), which caused two problems:

- Other tools unable to decompress the inlined extent

  U-boot and btrfs-restore are affected, as they only allocated a buffer
  which is @ram_bytes sized.
  That buffer is too small to contain the decompressed data, which is
  @sectorsize.

  Those projects are fixed to have a more robust decompression routine
  which can handle both cases now.

- Worse ratio for those compressed inline extent.

  For the same 3K 0xcd filled range, the results are small but
  observable, 48 vs 61 bytes.

Filipe's v1 fix is very close to a proper fix, but btrfs will unable to
create inlined extents for lzo.
It turns out to be another bug in the copy_compressed_data_to_bio()
function.

So this series is to properly fix the bug, firstly fix the lzo
regression which prevents inlined extent creation, then we can apply
Filipe's v1 fix.

However since Filipe's v3 is already in the for-next, the second patch
is reverting part of the v3 fix while keeping the extra size check, then
apply v1 fix.

If the series got reviewed, I'll change the 2nd patch to use Filipe's v1
fix with extra checks from v3 kept.

Qu Wenruo (2):
  btrfs: fix the incorrect lzo space saving checks
  btrfs: remove the trailing zeros from compressed inline extent

 fs/btrfs/inode.c |  7 +------
 fs/btrfs/lzo.c   | 32 +++++++++++++++++++++++++-------
 2 files changed, 26 insertions(+), 13 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-09-19 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-19 11:18 [PATCH 0/2] btrfs: remove the tailing zeros from compressed inline extents Qu Wenruo
2026-09-19 11:18 ` [PATCH 1/2] btrfs: fix the incorrect lzo space saving checks Qu Wenruo
2026-09-19 11:18 ` [PATCH 2/2] btrfs: remove the trailing zeros from compressed inline extent Qu Wenruo

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