smb/server: avoid registering async requests during connection close

A connection-close scan can miss the synthetic CHANGE_NOTIFY work item
because smb2_notify() registers it directly after setup_async_work()
has returned. Link both regular and synthetic async work through one
helper that checks the connection state under request_lock.

If the connection is already closing, release a newly allocated async
ID or complete the synthetic notify work immediately.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Co-developed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
ChenXiaoSong 2026-07-23 15:24:10 +09:00 • committed by Namjae Jeon
commit 528af7cf69