Skip to content

fs: btrfs: Fix false LZO decompression error due to missing page boundary check

Qu Wenruo linux-btrfs u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix code style problems
- Add a new patch to reject non-page-sized sector size Since kernel does the same thing, and non-4K page size u-boot boards are really rare, it shouldn't be a big problem.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fs: btrfs: Use LZO_LEN to replace immediate numberfs/btrfs/compression.c+12 -102 replies
2/3fs: btrfs: Reject fs with sector size other than PAGE_SIZEfs/btrfs/super.c+8 -02 replies
3/3fs: btrfs: Fix LZO false decompression error caused by pending zerofs/btrfs/compression.c+19 -12 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMarek Behún
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH U-BOOT v2 0/3] fs: btrfs: Fix false LZO decompression error due to missing page boundary check

There is a bug that uboot can't load LZO compressed data extent while kernel can handle it without any problem.

It turns out to be a page boundary case. The 3nd patch is the proper fix, cross-ported from btrfs-progs.

The first patch is just to make my eyes less hurt.
The second patch is to make sure the driver will reject sector size not matching PAGE_SIZE.
This keeps the behavior the same as kernel, even in theory we could do better in U-boot. This is just a temporary fix, before better btrfs driver implemented.

I guess it's time to backport proper code from btrfs-progs, other than using tons of immediate codes.

Changelog:
v2:
- Fix code style problems
- Add a new patch to reject non-page-sized sector size Since kernel does the same thing, and non-4K page size u-boot boards are really rare, it shouldn't be a big problem.

Qu Wenruo (3):
fs: btrfs: Use LZO_LEN to replace immediate number
fs: btrfs: Reject fs with sector size other than PAGE_SIZE
fs: btrfs: Fix LZO false decompression error caused by pending zero

 fs/btrfs/compression.c | 42 +++++++++++++++++++++++++++++++-----------
 fs/btrfs/super.c       |  8 ++++++++
 2 files changed, 39 insertions(+), 11 deletions(-)
Signature · 1 line
2.26.0