]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: Handle unaligned length in extent_same
authorMark Fasheh <mfasheh@suse.de>
Mon, 8 Jun 2015 22:05:25 +0000 (15:05 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 31 Oct 2016 10:43:03 +0000 (03:43 -0700)
commit70b85c5470433af08453dfbe0208beb6c41ed04f
treef5483c858e65b8a187ce45fbe862e183a663b1e8
parent39cdf38744050bbb946a5bc9fa590c6a0911b624
btrfs: Handle unaligned length in extent_same

The extent-same code rejects requests with an unaligned length. This
poses a problem when we want to dedupe the tail extent of files as we
skip cloning the portion between i_size and the extent boundary.

If we don't clone the entire extent, it won't be deleted. So the
combination of these behaviors winds up giving us worst-case dedupe on
many files.

We can fix this by allowing a length that extents to i_size and
internally aligining those to the end of the block. This is what
btrfs_ioctl_clone() so we can just copy that check over.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit e1d227a42ea2b4664f94212bd1106b9a3413ffb8)
Signed-off-by: Divya Indi <divya.indi@oracle.com>
Orabug: 24696342
fs/btrfs/ioctl.c