ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 19 Jun 2022 13:35:48 +0000 (22:35 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Jul 2022 15:53:23 +0000 (17:53 +0200)
commit6791b57284f59715602e952f6eef8e6303108cf6
treed0946076bc88518db4ac4346e76694e96d4608f7
parent31c371b61d13dd457fdcc27cd728c04ee09f9cdb
ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA

commit 18e39fb960e6a908ac5230b57e3d0d6c25232368 upstream.

generic/091, 263 test failed since commit f66f8b94e7f2 ("cifs: when
extending a file with falloc we should make files not-sparse").
FSCTL_ZERO_DATA sets the range of bytes to zero without extending file
size. The VFS_FALLOCATE_FL_KEEP_SIZE flag should be used even on
non-sparse files.

Cc: stable@vger.kernel.org
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/vfs.c