Skip to content

Allow deduplication of the eof block when it is safe to do so

[email protected] linux-btrfs linux-fsdevel linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs: allow deduplication of eof block into the end of the destination filefs/read_write.c+4 -610 replies
2/2Btrfs: make deduplication with range including the last block workfs/btrfs/ioctl.c+2 -16 replies

Reviews trailers per patch

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

PatchJosef BacikDarrick J. Wong
1/2R-b R-b
2/2R-b

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

Read the v1 thread

Cover letter [PATCH 0/2] Allow deduplication of the eof block when it is safe to do so

From: Filipe Manana <[email protected]>

Hi,

This short series allows deduplication of the last block of a file when the eof is not aligned to the sector size, as long as the range's end offset matches the eof of the destination file.

This is a safe case unlike the case where we attempt to clone the block in the middle of a file (which results in a corruption I found last year and affected both btrfs and xfs).

This is motivated by btrfs users reporting lower deduplication scores starting with kernel 5.0, which was the kernel release where btrfs was changed to use the generic VFS helper generic_remap_file_range_prep(). Users observed that the last block was no longer deduplicated when a file's size is not block size aligned. For btrfs this is specially important because references are kept per extent and not per block, so not having the last block deduplicated means the entire extent is kept allocated, making the deduplication not effective and often pointless in many cases.

Thanks.

Filipe Manana (2):
fs: allow deduplication of eof block into the end of the destination
file
Btrfs: make deduplication with range including the last block work

 fs/btrfs/ioctl.c |  3 ++-
 fs/read_write.c  | 10 ++++------
 2 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0