diff options
| author | Huiwen He <hehuiwen@kylinos.cn> | 2026-08-28 15:19:31 +0800 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-08-30 14:04:20 -0300 |
| commit | cd03ce4950d80147ac8f20bc03c42b75b0352407 (patch) | |
| tree | a7414b4bcd93c63de79b29f1d8df78dd84d3c95c /include/linux | |
| parent | 88972e35750792e717af287dc71f42a03b5cbce4 (diff) | |
smb/client: mark file sparse before emulating insert range
The SMB client emulates FALLOC_FL_INSERT_RANGE with SET_EOF, COPYCHUNK
and SET_ZERO_DATA.
SET_ZERO_DATA creates a hole only when the file is sparse. On a
non-sparse file, it clears the inserted range but leaves its blocks
allocated, causing the extent count check in xfstests generic/064 to
fail.
Fix this by marking the file sparse before modifying it.
This patch produces the expected sparse extents in xfstests generic/064
only when the server-reported block size is compatible with the server's
deallocation granularity.
For ksmbd, the reported block size follows the backing filesystem,
and the test passes. For Samba, the test passes with a block size
matching the backend granularity, for example, 4 KiB on Btrfs, but not
with the default 1 KiB value. For Windows Server 2022, 4 KiB inserts do
not generate holes, while aligned inserts of 64 KiB or larger do.
Fixes: 7fe6fe95b936 ("cifs: add FALLOC_FL_INSERT_RANGE support")
Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
