This is a note to let you know that I've just added the patch titled ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ksmbd-set-the-range-of-bytes-to-zero-without-extending-file-size-in-fsctl_zero_data.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 18e39fb960e6a908ac5230b57e3d0d6c25232368 Mon Sep 17 00:00:00 2001 From: Namjae Jeon <linkinjeon@xxxxxxxxxx> Date: Sun, 19 Jun 2022 22:35:48 +0900 Subject: ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA From: Namjae Jeon <linkinjeon@xxxxxxxxxx> 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@xxxxxxxxxxxxxxx Reviewed-by: Hyunchul Lee <hyc.lee@xxxxxxxxx> Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ksmbd/vfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ksmbd/vfs.c +++ b/fs/ksmbd/vfs.c @@ -1015,7 +1015,9 @@ int ksmbd_vfs_zero_data(struct ksmbd_wor FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, len); - return vfs_fallocate(fp->filp, FALLOC_FL_ZERO_RANGE, off, len); + return vfs_fallocate(fp->filp, + FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE, + off, len); } int ksmbd_vfs_fqar_lseek(struct ksmbd_file *fp, loff_t start, loff_t length, Patches currently in stable-queue which might be from linkinjeon@xxxxxxxxxx are queue-5.18/ksmbd-check-invalid-fileoffset-and-beyondfinalzero-in-fsctl_zero_data.patch queue-5.18/ksmbd-use-vfs_llseek-instead-of-dereferencing-null.patch queue-5.18/ksmbd-set-the-range-of-bytes-to-zero-without-extending-file-size-in-fsctl_zero_data.patch