diff options
| author | DaeMyung Kang <charsyam@gmail.com> | 2026-10-17 12:40:51 +0900 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-21 08:55:33 +0900 |
| commit | aad7d86a6651efefb2c0a4f02c86dfeff3c176a2 (patch) | |
| tree | 3734d0f2349b8fac84cfebe89384e237378588ec /scripts/Makefile.thinlto | |
| parent | 9455e920aebe41217cabff3f81e90da4c407fdb6 (diff) | |
| download | linux-aad7d86a6651efefb2c0a4f02c86dfeff3c176a2.tar.gz linux-aad7d86a6651efefb2c0a4f02c86dfeff3c176a2.zip | |
ksmbd: round SetAllocation to the advertised allocation unit
SetAllocation rounds requests to 512-byte blocks, although
FS_SIZE_INFORMATION advertises the filesystem's f_bsize as its
allocation unit. For example, on a filesystem with a 4 KiB unit, a
1000-byte request can truncate an 8 KiB file to 1024 bytes instead of
4 KiB.
Round the request to the advertised unit and use the same result for
the block-count decision, fallocate, truncate, and the size stored on
the open handle. Validate the unit and rounded size before either
operation. Use DIV_ROUND_UP_ULL() so the calculation works on 32-bit
kernels.
This does not change the existing block-count decision for whether to
call fallocate. In particular, success does not yet guarantee
reservation of holes within the requested range on a sparse file.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
