diff options
| author | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-20 10:19:19 +0900 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-21 08:55:35 +0900 |
| commit | df5c868f6b80ca16c171cfac5e4e6c9be83ba4c2 (patch) | |
| tree | dca6fe30d2cf9ef4eedb846645994a99f4a5996c /scripts/Makefile.thinlto | |
| parent | 1c087cf7d5386c708d8984b263280b42b3daada0 (diff) | |
| download | linux-df5c868f6b80ca16c171cfac5e4e6c9be83ba4c2.tar.gz linux-df5c868f6b80ca16c171cfac5e4e6c9be83ba4c2.zip | |
ksmbd: fix fd_limit accounting across durable reconnects
A disconnected durable handle keeps its ksmbd_file and the fd_limit
reservation taken at its initial open. Reconnecting allocates another
volatile ID and takes another reservation for the same file. Final close
returns only one reservation, so repeated reconnects permanently reduce
the server-wide open-file budget.
Move reservation into ksmbd_open_fd() and release it on every creation
failure. Keep the reservation until final close, including while a durable
handle is disconnected. Make ID allocation independent of fd_limit so
reconnects neither consume nor return slots. This also avoids returning an
unreserved slot when persistent ID allocation fails.
New opens continue to return -EMFILE when the budget is exhausted, keeping
the existing STATUS_INSUFFICIENT_RESOURCES mapping.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Mohammed <mohammed.saad.alquraini@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
