Skip to content

Commit 18e39fb

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA
generic/091, 263 test failed since commit f66f8b9 ("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: [email protected] Reviewed-by: Hyunchul Lee <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 745bbc0 commit 18e39fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ksmbd/vfs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,9 @@ int ksmbd_vfs_zero_data(struct ksmbd_work *work, struct ksmbd_file *fp,
10151015
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
10161016
off, len);
10171017

1018-
return vfs_fallocate(fp->filp, FALLOC_FL_ZERO_RANGE, off, len);
1018+
return vfs_fallocate(fp->filp,
1019+
FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE,
1020+
off, len);
10191021
}
10201022

10211023
int ksmbd_vfs_fqar_lseek(struct ksmbd_file *fp, loff_t start, loff_t length,

0 commit comments

Comments
 (0)