ksmbd: synchronize lease breaks before renaming files

Break read and handle caching leases before entering the VFS rename path.
This keeps the destination name hidden until the lease holder acknowledges
the break.

Send the break synchronously before returning STATUS_PENDING for a rename.
This avoids a race between the interim response and notification handling.
Keep the existing asynchronous notification flow for all other lease break
paths so chained breaks retain their ordering.

Use the connection which owns the open for the notification.  A lease table
is shared by connections using the same client GUID.  Its saved connection
may belong to another active channel.  Use it only when the owning channel
is being released.

Check directory sharing before issuing a break to avoid unnecessary lease
breaks for a rename that must fail with a sharing violation.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Namjae Jeon 2026-07-14 21:41:06 +09:00
commit 7f8029591b
5 changed files with 78 additions and 47 deletions