]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix fallocate when trying to allocate a hole.
authorRonnie Sahlberg <lsahlber@redhat.com>
Fri, 23 Jul 2021 01:21:24 +0000 (11:21 +1000)
committerSteve French <stfrench@microsoft.com>
Fri, 23 Jul 2021 02:24:22 +0000 (21:24 -0500)
commitf8ccb3d9b525c0ea58710af0bae8c41e2a82e114
treee1ba134c928ddc08a1453c9067ab67c8861d8c79
parent9e588c892b73eae6a65764d8b62deafbe574080d
cifs: fix fallocate when trying to allocate a hole.

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: d05a54c8f603 ("cifs: improve fallocate emulation")
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c