1 From 18e39fb960e6a908ac5230b57e3d0d6c25232368 Mon Sep 17 00:00:00 2001
2 From: Namjae Jeon <linkinjeon@kernel.org>
3 Date: Sun, 19 Jun 2022 22:35:48 +0900
4 Subject: ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA
6 From: Namjae Jeon <linkinjeon@kernel.org>
8 commit 18e39fb960e6a908ac5230b57e3d0d6c25232368 upstream.
10 generic/091, 263 test failed since commit f66f8b94e7f2 ("cifs: when
11 extending a file with falloc we should make files not-sparse").
12 FSCTL_ZERO_DATA sets the range of bytes to zero without extending file
13 size. The VFS_FALLOCATE_FL_KEEP_SIZE flag should be used even on
16 Cc: stable@vger.kernel.org
17 Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
18 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
19 Signed-off-by: Steve French <stfrench@microsoft.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 fs/ksmbd/vfs.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
27 @@ -1018,7 +1018,9 @@ int ksmbd_vfs_zero_data(struct ksmbd_wor
28 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
31 - return vfs_fallocate(fp->filp, FALLOC_FL_ZERO_RANGE, off, len);
32 + return vfs_fallocate(fp->filp,
33 + FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE,
37 int ksmbd_vfs_fqar_lseek(struct ksmbd_file *fp, loff_t start, loff_t length,