Skip to content

btrfs: fix unpaired compr folio allocation/freeing

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix the incorrect freeing of a compression folio in btrfs_submit_compressed_read()fs/btrfs/compression.c+1 -10 replies
2/2btrfs: fix the incorrect freeing of a compression folio in btrfs_do_encoded_write()fs/btrfs/inode.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: fix unpaired compr folio allocation/freeing

With the recent *_compressed_bio() rework, we're using compressed_bio everywhere for reads/writes (including regular and encoded).

However this requires us to allocate/free folios using btrfs_alloc_compr_folio() and btrfs_free_compr_folio().

Not using the later to release a folio allocated by btrfs_alloc_compr_folio() can screw up the LRU list.

Fix the unpaired calls as a hot fix.

For the long run, I'd like to remove btrfs_(alloc|free)_compr_folios() with regular folio_(alloc|put)() instead.
As I do not think the compr pool is that helpful compared to the extra maintanance needed.

Qu Wenruo (2):
btrfs: fix the incorrect freeing of a compression folio in
btrfs_submit_compressed_read()
btrfs: fix the incorrect freeing of a compression folio in
btrfs_do_encoded_write()

 fs/btrfs/compression.c | 2 +-
 fs/btrfs/inode.c       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0