Ronnie Sahlberg 76f7eae7ec cifs: fix fallocate when trying to allocate a hole.
[ Upstream commit 488968a8945c119859d91bb6a8dc13bf50002f15 ]

Remove the conditional checking for out_data_len and skipping the fallocate
if it is 0. This is wrong will actually change any legitimate the fallocate
where the entire region is unallocated into a no-op.

Additionally, before allocating the range, if FALLOC_FL_KEEP_SIZE is set then
we need to clamp the length of the fallocate region as to not extend the size of the file.

Fixes: 966a3cb7c7db ("cifs: improve fallocate emulation")
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-28 14:35:42 +02:00
..
2020-10-22 12:17:52 -05:00
2020-06-01 00:10:18 -05:00
2020-11-15 23:05:33 -06:00
2020-06-01 00:10:18 -05:00
2021-01-19 18:27:19 +01:00
2020-07-09 10:06:52 -05:00
2020-10-22 12:16:24 -05:00
2020-08-02 18:00:25 -05:00
2007-06-05 18:30:44 +00:00
2020-06-01 00:10:18 -05:00
2019-01-24 09:37:33 -06:00