]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: simplify inline extent handling when doing reflinks
authorFilipe Manana <fdmanana@suse.com>
Fri, 28 Feb 2020 13:04:18 +0000 (13:04 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:54 +0000 (17:01 +0100)
commit983301cb8a6b2e1bc08e11d1c877751ab001e3af
tree588235bb5055a57230b807ba9ef96f699871d56a
parent7efdabd72279883971286da0fa13c39accc0b277
Btrfs: simplify inline extent handling when doing reflinks

We can not reflink parts of an inline extent, we must always reflink the
whole inline extent. We know that inline extents always start at file
offset 0 and that can never represent an amount of data larger then the
filesystem's sector size (both compressed and uncompressed). We also have
had the constraints that reflink operations must have a start offset that
is aligned to the sector size and an end offset that is also aligned or
it ends the inode's i_size, so there's no way for user space to be able
to do a reflink operation that will refer to only a part of an inline
extent.

Initially there was a bug in the inlining code that could allow compressed
inline extents that encoded more than 1 page, but that was fixed in 2008
by commit 4a01201a549bee ("Btrfs: Compression corner fixes") since that
was problematic.

So remove all the extent cloning code that deals with the possibility
of cloning only partial inline extents.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reflink.c