smb2_server: don't cancel pending request if at least one channel is still alive
authorStefan Metzmacher <metze@samba.org>
Wed, 24 Feb 2021 16:44:12 +0000 (17:44 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 29 Mar 2021 19:36:37 +0000 (19:36 +0000)
commitf0e553783434dccf0637e6e9e3a87890ae56286c
tree5c2464ddbcd117c254aaaa87fdc5a8bf25d86511
parent01b675ab323a73fc0cf25cd0bf706dbc1dde514b
smb2_server: don't cancel pending request if at least one channel is still alive

In order to allow replays of requests on a channel failure, we should
not cancel pending requests, the strategie that seems to make windows
clients happy is to let the requests running and return
NT_STATUS_FILE_NOT_AVAILABLE as long as the original request is still
pending.

Here we introduce xconn->transport.shutdown_wait_queue, this is used
to keep the xconn alive for the lifetime of pending requests.

Now we only cancel pending requests if the disconnected connection
is the last channel for a session.

In that case smbXsrv_session_remove_channel() and
smb2srv_session_shutdown_send() will take care of it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14449

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/smb2.replay
source3/smbd/globals.h
source3/smbd/smb2_server.c
source3/smbd/smbXsrv_session.c