Re: [PATCH 0/2] ksmbd: fix SetAllocation EOF and rounding
From: Namjae Jeon
Date: Mon Oct 19 2026 - 19:48:23 EST
On Sat, Oct 17, 2026 at 12:40 PM DaeMyung Kang <charsyam@xxxxxxxxx> wrote:
>
> In response to Namjae's review of my earlier SetAllocation patch, this
> series separates two fixes. Patch 1/2 prevents the existing cleanup
> branch from extending EOF on disk and then restoring only the in-memory
> size. It carries Fixes and Cc: stable. Patch 2/2 rounds the request to
> f_bsize, the allocation unit ksmbd advertises in FS_SIZE_INFORMATION,
> instead of 512 bytes.
>
> The other review point, reserving the requested range when shrinking,
> remains open. I tried fallocate before truncate, but the decision to
> shrink uses an EOF value read before vfs_truncate() takes inode_lock.
> The existing block-count branch already has this race; extending
> truncate to additional sparse-file cases would expose it more widely.
> If another client truncates and writes in that interval, our truncate
> can extend the file again with zeros. I reproduced this with an
> injected delay in QEMU. Rechecking EOF after fallocate narrows the
> window but does not close it.
>
> A VFS operation that checks EOF and truncates under the same inode_lock
> without extending the file may be needed. I plan to discuss the
> reservation fix separately with linux-fsdevel and would welcome your
> thoughts on that approach.
>
> DaeMyung Kang (2):
> ksmbd: avoid restoring only in-memory EOF after allocation change
> ksmbd: round SetAllocation to the advertised allocation unit
Applied them to #ksmbd-for-next.
Thanks!