On Wed, May 27, 2020 at 11:15:53AM +0100, fdmanana@xxxxxxxxxx wrote:
> From: Filipe Manana <fdmanana@xxxxxxxx>
>
> If an error happens while running dellaloc in COW mode for a range, we can
> end up calling extent_clear_unlock_delalloc() for a range that goes beyond
> our range's end offset by 1 byte, which affects 1 extra page. This results
> in clearing bits and doing page operations (such as a page unlock) outside
> our target range.
>
> Fix that by calling extent_clear_unlock_delalloc() with an inclusive end
> offset, instead of an exclusive end offset, at cow_file_range().
>
> Fixes: a315e68f6e8b30 ("Btrfs: fix invalid attempt to free reserved space on failure to cow range")
> Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>
1-3 added to misc-next, thanks.