Filipe Manana e2c8e92d11 btrfs: fix wrong file range cleanup after an error filling dealloc range
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")
CC: stable@vger.kernel.org # 4.14+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-28 14:01:53 +02:00
..
2020-03-23 17:02:00 +01:00
2020-05-25 11:25:36 +02:00
2020-05-25 11:25:36 +02:00
2020-05-25 11:25:37 +02:00
2019-11-18 23:43:44 +01:00
2020-05-25 11:25:37 +02:00
2020-03-23 17:01:43 +01:00
2020-01-20 16:40:55 +01:00
2020-05-25 11:25:37 +02:00
2019-11-18 17:51:51 +01:00
2020-05-25 11:25:37 +02:00
2020-05-25 11:25:36 +02:00
2020-05-25 11:25:36 +02:00
2020-05-25 11:25:37 +02:00
2020-05-25 11:25:37 +02:00
2020-05-25 11:25:36 +02:00